Translate command usage messages server-side, close #236

This commit is contained in:
Dylan K. Taylor 2017-07-30 21:14:40 +01:00
parent ffefcd4473
commit acaa0d2740

View File

@ -236,7 +236,7 @@ class SimpleCommandMap implements CommandMap{
try{
$target->execute($sender, $sentCommandLabel, $args);
}catch(InvalidCommandSyntaxException $e){
$sender->sendMessage(new TranslationContainer("commands.generic.usage", [$target->getUsage()]));
$sender->sendMessage($this->server->getLanguage()->translateString("commands.generic.usage", [$target->getUsage()]));
}catch(\Throwable $e){
$sender->sendMessage(new TranslationContainer(TextFormat::RED . "%commands.generic.exception"));
$this->server->getLogger()->critical($this->server->getLanguage()->translateString("pocketmine.command.exception", [$commandLine, (string) $target, $e->getMessage()]));