mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-15 19:46:20 +00:00
Added KnownTranslationFactory and use it in as many places as possible
this makes translation usage much more statically analysable. The only places this isn't used are: - places that prefix translations with colours (those are still a problem) - places where server/client translations don't match (e.g. gameMode.changed accepts different parameters in vanilla than in PM)
This commit is contained in:
@@ -33,7 +33,7 @@ use pocketmine\event\player\PlayerDuplicateLoginEvent;
|
||||
use pocketmine\event\server\DataPacketReceiveEvent;
|
||||
use pocketmine\event\server\DataPacketSendEvent;
|
||||
use pocketmine\form\Form;
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\math\Vector3;
|
||||
use pocketmine\nbt\tag\CompoundTag;
|
||||
use pocketmine\nbt\tag\StringTag;
|
||||
@@ -581,7 +581,7 @@ class NetworkSession{
|
||||
}
|
||||
|
||||
if($error !== null){
|
||||
$this->disconnect($this->server->getLanguage()->translateString(KnownTranslationKeys::POCKETMINE_DISCONNECT_INVALIDSESSION, [$error]));
|
||||
$this->disconnect($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_disconnect_invalidSession($error)));
|
||||
|
||||
return;
|
||||
}
|
||||
|
@@ -25,7 +25,7 @@ namespace pocketmine\network\mcpe\handler;
|
||||
|
||||
use pocketmine\entity\InvalidSkinException;
|
||||
use pocketmine\event\player\PlayerPreLoginEvent;
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\network\mcpe\auth\ProcessLoginTask;
|
||||
use pocketmine\network\mcpe\convert\SkinAdapterSingleton;
|
||||
use pocketmine\network\mcpe\JwtException;
|
||||
@@ -83,7 +83,7 @@ class LoginPacketHandler extends PacketHandler{
|
||||
|
||||
//This pocketmine disconnect message will only be seen by the console (PlayStatusPacket causes the messages to be shown for the client)
|
||||
$this->session->disconnect(
|
||||
$this->server->getLanguage()->translateString(KnownTranslationKeys::POCKETMINE_DISCONNECT_INCOMPATIBLEPROTOCOL, [$packet->protocol]),
|
||||
$this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_disconnect_incompatibleProtocol((string) $packet->protocol)),
|
||||
false
|
||||
);
|
||||
|
||||
|
@@ -27,7 +27,7 @@ declare(strict_types=1);
|
||||
*/
|
||||
namespace pocketmine\network\query;
|
||||
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\network\AdvancedNetworkInterface;
|
||||
use pocketmine\network\RawPacketHandler;
|
||||
use pocketmine\Server;
|
||||
@@ -71,7 +71,7 @@ class QueryHandler implements RawPacketHandler{
|
||||
|
||||
$this->regenerateToken();
|
||||
$this->lastToken = $this->token;
|
||||
$this->logger->info($this->server->getLanguage()->translateString(KnownTranslationKeys::POCKETMINE_SERVER_QUERY_RUNNING, [$addr, $port]));
|
||||
$this->logger->info($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_server_query_running($addr, (string) $port)));
|
||||
}
|
||||
|
||||
public function getPattern() : string{
|
||||
|
Reference in New Issue
Block a user