This class is used to format the strings for localization, it changes the tags with its corresponding value deffined in the cfg files and also it calls the LingoonaGrammar library when neccesary. It uses internally a singleton, but all its public methods are static.
More...
|
static void | AppendMissionTags (string lang) |
|
static string | Format (string template, params string[] list) |
| See Lingoona Grammar documentation first. Format the template string with the given string list as local variables Any parameter of this method (either the template string or any element of the list) can be replaced by a tag deffined in a localization cfg More...
|
|
static string | Format (string template, params System.Object[] list) |
|
static string | Format (string template) |
|
static string | GetLanguageIdFromFile () |
| Reads and return the language ID dependeing of the running platform. More...
|
|
static string | GetStringByTag (string tag) |
| Get the string stored for a tagname More...
|
|
static Localizer | Init () |
| Should be called at the starting, before using this class but when the GameDatabase is already loaded. More...
|
|
static bool | SwitchToLanguage (string lang) |
| Switch the dictionary to another Language. Assets already Localized don't change, only the dictionary. More...
|
|
static void | TranslateBranch (ConfigNode branchRoot) |
| Translate a ConfigNode branch with branchRoot as root. Instance should be loaded. More...
|
|
static bool | TryGetStringByTag (string tagName, out string value) |
|
This class is used to format the strings for localization, it changes the tags with its corresponding value deffined in the cfg files and also it calls the LingoonaGrammar library when neccesary. It uses internally a singleton, but all its public methods are static.
static void KSP.Localization.Localizer.AppendMissionTags |
( |
string |
lang | ) |
|
|
inlinestatic |
static string KSP.Localization.Localizer.Format |
( |
string |
template, |
|
|
params string[] |
list |
|
) |
| |
|
inlinestatic |
See Lingoona Grammar documentation first. Format the template string with the given string list as local variables Any parameter of this method (either the template string or any element of the list) can be replaced by a tag deffined in a localization cfg
- Parameters
-
template | This can be either a LingoonaGrammar template, a tag for a template, raw text or a tag for raw text |
list | This list indicates the local variables for the LingoonaGrammar template, if a tag is provided, the value will be replaced by the tag automatically |
- Returns
- The formatted string
static string KSP.Localization.Localizer.Format |
( |
string |
template, |
|
|
params System.Object[] |
list |
|
) |
| |
|
inlinestatic |
static string KSP.Localization.Localizer.Format |
( |
string |
template | ) |
|
|
inlinestatic |
static string KSP.Localization.Localizer.GetLanguageIdFromFile |
( |
| ) |
|
|
inlinestatic |
Reads and return the language ID dependeing of the running platform.
- Returns
- Current language ID.
static string KSP.Localization.Localizer.GetStringByTag |
( |
string |
tag | ) |
|
|
inlinestatic |
Get the string stored for a tagname
static Localizer KSP.Localization.Localizer.Init |
( |
| ) |
|
|
inlinestatic |
Should be called at the starting, before using this class but when the GameDatabase is already loaded.
static bool KSP.Localization.Localizer.SwitchToLanguage |
( |
string |
lang | ) |
|
|
inlinestatic |
Switch the dictionary to another Language. Assets already Localized don't change, only the dictionary.
- Parameters
-
lang | Id of the new language. |
- Returns
- True when successful
static void KSP.Localization.Localizer.TranslateBranch |
( |
ConfigNode |
branchRoot | ) |
|
|
inlinestatic |
Translate a ConfigNode branch with branchRoot as root. Instance should be loaded.
///
- Parameters
-
branchRoot | Node root of the branch to be translated. |
static bool KSP.Localization.Localizer.TryGetStringByTag |
( |
string |
tagName, |
|
|
out string |
value |
|
) |
| |
|
inlinestatic |
string KSP.Localization.Localizer.CurrentLanguage |
|
staticget |
The Current Language set in game.
Localizer KSP.Localization.Localizer.Instance |
|
staticgetset |
Singletone Instance for the class
Dictionary<string,string> KSP.Localization.Localizer.Tags |
|
staticget |
int KSP.Localization.Localizer.TagsLength |
|
staticget |
The documentation for this class was generated from the following file: