Stop auto-translating string descriptions/usages for commands

Require usage of Translatable for translations.
This commit is contained in:
Dylan K. Taylor
2021-09-11 16:46:40 +01:00
parent b65e3c69b1
commit 3b7580688c
43 changed files with 104 additions and 131 deletions

View File

@@ -35,6 +35,7 @@ use pocketmine\event\server\DataPacketSendEvent;
use pocketmine\form\Form;
use pocketmine\lang\KnownTranslationFactory;
use pocketmine\lang\KnownTranslationKeys;
use pocketmine\lang\Translatable;
use pocketmine\math\Vector3;
use pocketmine\nbt\tag\CompoundTag;
use pocketmine\nbt\tag\StringTag;
@@ -832,9 +833,10 @@ class NetworkSession{
$aliasObj = new CommandEnum(ucfirst($command->getName()) . "Aliases", array_values($aliases));
}
$description = $command->getDescription();
$data = new CommandData(
$lname, //TODO: commands containing uppercase letters in the name crash 1.9.0 client
$this->player->getLanguage()->translateString($command->getDescription()),
$description instanceof Translatable ? $this->player->getLanguage()->translate($description) : $description,
0,
0,
$aliasObj,