mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-09 03:06:55 +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:
@ -26,8 +26,8 @@ namespace pocketmine\command\defaults;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\command\utils\InvalidCommandSyntaxException;
|
||||
use pocketmine\data\java\GameModeIdMap;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\lang\TranslationContainer;
|
||||
use pocketmine\permission\DefaultPermissionNames;
|
||||
use pocketmine\player\GameMode;
|
||||
use function count;
|
||||
@ -59,7 +59,7 @@ class DefaultGamemodeCommand extends VanillaCommand{
|
||||
}
|
||||
|
||||
$sender->getServer()->getConfigGroup()->setConfigInt("gamemode", GameModeIdMap::getInstance()->toId($gameMode));
|
||||
$sender->sendMessage(new TranslationContainer(KnownTranslationKeys::COMMANDS_DEFAULTGAMEMODE_SUCCESS, [$gameMode->getTranslationKey()]));
|
||||
$sender->sendMessage(KnownTranslationFactory::commands_defaultgamemode_success($gameMode->getTranslationKey()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user