mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
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:
parent
0c88c18ea0
commit
2017d5d652
54 changed files with 1658 additions and 660 deletions
|
|
@ -16,12 +16,27 @@ namespace MinecraftClient
|
|||
/// <summary>
|
||||
/// The command name
|
||||
/// </summary>
|
||||
public abstract string CMDName { get; }
|
||||
public abstract string CmdName { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Usage message, eg: 'name [args]: do something'
|
||||
/// Command description with translation support. Please add your message in Translations.cs file and return mapping key in this property
|
||||
/// </summary>
|
||||
public abstract string CMDDesc { get; }
|
||||
public abstract string CmdDesc { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Get the translated version of command description.
|
||||
/// </summary>
|
||||
/// <returns>Translated command description</returns>
|
||||
public string GetCmdDescTranslated()
|
||||
{
|
||||
string s = string.IsNullOrEmpty(CmdUsage) || string.IsNullOrEmpty(CmdDesc) ? "" : ": "; // If either one is empty, no colon :
|
||||
return CmdUsage + s + Translations.TryGet(CmdDesc);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Usage message, eg: 'name [args]'
|
||||
/// </summary>
|
||||
public abstract string CmdUsage { get; }
|
||||
|
||||
/// <summary>
|
||||
/// Perform the command
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue