Added KnownTranslationKeys (generated) and start using it

This commit is contained in:
Dylan K. Taylor
2021-06-29 22:46:04 +01:00
parent f02817bcd3
commit 94e16f416d
57 changed files with 802 additions and 286 deletions

View File

@@ -26,6 +26,7 @@ namespace pocketmine\command\defaults;
use pocketmine\command\Command;
use pocketmine\command\CommandSender;
use pocketmine\command\utils\InvalidCommandSyntaxException;
use pocketmine\lang\KnownTranslationKeys;
use pocketmine\lang\TranslationContainer;
use pocketmine\permission\DefaultPermissionNames;
use pocketmine\player\Player;
@@ -38,8 +39,8 @@ class DeopCommand extends VanillaCommand{
public function __construct(string $name){
parent::__construct(
$name,
"%pocketmine.command.deop.description",
"%commands.deop.usage"
"%" . KnownTranslationKeys::POCKETMINE_COMMAND_DEOP_DESCRIPTION,
"%" . KnownTranslationKeys::COMMANDS_DEOP_USAGE
);
$this->setPermission(DefaultPermissionNames::COMMAND_OP_TAKE);
}
@@ -62,7 +63,7 @@ class DeopCommand extends VanillaCommand{
if(($player = $sender->getServer()->getPlayerExact($name)) !== null){
$player->sendMessage(TextFormat::GRAY . "You are no longer op!");
}
Command::broadcastCommandMessage($sender, new TranslationContainer("commands.deop.success", [$name]));
Command::broadcastCommandMessage($sender, new TranslationContainer(KnownTranslationKeys::COMMANDS_DEOP_SUCCESS, [$name]));
return true;
}