Crowdin localization support (#2310)

* Switching to use resource files

* Update Crowdin configuration file

* Code cleanup
This commit is contained in:
BruceChen 2022-10-28 11:13:20 +08:00 committed by GitHub
parent a27491c1b6
commit 077e3a5e9f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
193 changed files with 102089 additions and 3564 deletions

View file

@ -9,7 +9,7 @@ namespace MinecraftClient.Commands
{
public override string CmdName { get { return "execif"; } }
public override string CmdUsage { get { return "execif <condition/expression> ---> <command>"; } }
public override string CmdDesc { get { return "cmd.execif.desc"; } }
public override string CmdDesc { get { return Translations.cmd_execif_desc; } }
public override string Run(McClient handler, string command, Dictionary<string, object>? localVars)
{
@ -69,8 +69,9 @@ namespace MinecraftClient.Commands
handler.PerformInternalCommand(resultCommand, ref output);
if (string.IsNullOrEmpty(output))
handler.Log.Debug(Translations.TryGet("cmd.execif.executed_no_output", expressionText, resultCommand));
else handler.Log.Debug(Translations.TryGet("cmd.execif.executed", expressionText, resultCommand, output));
handler.Log.Debug(string.Format(Translations.cmd_execif_executed_no_output, expressionText, resultCommand));
else
handler.Log.Debug(string.Format(Translations.cmd_execif_executed, expressionText, resultCommand, output));
return "";
}
@ -79,8 +80,8 @@ namespace MinecraftClient.Commands
}
catch (Exception e)
{
handler.Log.Error(Translations.TryGet("cmd.execif.error_occured", command));
handler.Log.Error(Translations.TryGet("cmd.execif.error", e.Message));
handler.Log.Error(string.Format(Translations.cmd_execif_error_occured, command));
handler.Log.Error(string.Format(Translations.cmd_execif_error, e.Message));
return "";
}
}