mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-16 11:58:00 +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:
@@ -25,8 +25,8 @@ namespace pocketmine\command\defaults;
|
||||
|
||||
use pocketmine\command\Command;
|
||||
use pocketmine\command\CommandSender;
|
||||
use pocketmine\lang\KnownTranslationFactory;
|
||||
use pocketmine\lang\KnownTranslationKeys;
|
||||
use pocketmine\lang\TranslationContainer;
|
||||
use pocketmine\permission\DefaultPermissionNames;
|
||||
use function microtime;
|
||||
use function round;
|
||||
@@ -47,7 +47,7 @@ class SaveCommand extends VanillaCommand{
|
||||
return true;
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer(KnownTranslationKeys::POCKETMINE_SAVE_START));
|
||||
Command::broadcastCommandMessage($sender, KnownTranslationFactory::pocketmine_save_start());
|
||||
$start = microtime(true);
|
||||
|
||||
foreach($sender->getServer()->getOnlinePlayers() as $player){
|
||||
@@ -58,7 +58,7 @@ class SaveCommand extends VanillaCommand{
|
||||
$world->save(true);
|
||||
}
|
||||
|
||||
Command::broadcastCommandMessage($sender, new TranslationContainer(KnownTranslationKeys::POCKETMINE_SAVE_SUCCESS, [round(microtime(true) - $start, 3)]));
|
||||
Command::broadcastCommandMessage($sender, KnownTranslationFactory::pocketmine_save_success((string) round(microtime(true) - $start, 3)));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Reference in New Issue
Block a user