Add support of language files (#1273)

* Basic support of language file
Only mapped main part of MCC.
* Translations function imporve
* Change translation file naming
* Fix default translation file naming
* Complete translation file mapping for main part
Command and ChatBot not done yet
* Complete translation mapping for commands
Except Entitycmd
* Complete translation mapping for ChatBots
* Add new method for replacing translation key
Just for Entitycmd. Be proud of yourself. We have a convenient method now.
* Complete all translation mapping
* Add default config and translation file to resource
* Remove untranslatable messages from default translation file
This commit is contained in:
ReinforceZwei 2020-10-17 19:41:31 +08:00 committed by GitHub
parent 0c88c18ea0
commit 2017d5d652
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 1658 additions and 660 deletions

View file

@ -7,8 +7,9 @@ namespace MinecraftClient.Commands
{
class Tps : Command
{
public override string CMDName { get { return "tps"; } }
public override string CMDDesc { get { return "Display server current tps (tick per second). May not be accurate"; } }
public override string CmdName { get { return "tps"; } }
public override string CmdUsage { get { return "tps"; } }
public override string CmdDesc { get { return "cmd.tps.desc"; } }
public override string Run(McClient handler, string command, Dictionary<string, object> localVars)
{
@ -19,7 +20,7 @@ namespace MinecraftClient.Commands
else if (tps < 15)
color = "§e"; // Yellow
else color = "§a"; // Green
return "Current tps: " + color + tps;
return Translations.Get("cmd.tps.current") + ": " + color + tps;
}
}
}