Holds a lanugage for localisation: includes a dictionary (string->string) and a font. Can be saved and loaded from XML.
More...
|
void | AddTranslation (string input, string output) |
| Adds a translation to the dictionary. More...
|
|
void | Deserialize (string path, bool localPath=true) |
| Loads language from specified xml file (path under GameData by default, else set localPath false for absolute path) More...
|
|
| LanguageDefinition () |
|
| LanguageDefinition (string langName, string fontName) |
| Creates an empty language with given name and font. More...
|
|
| LanguageDefinition (string path, bool localPath=true) |
| Loads language from specified path (path under GameData by default, else set localPath false for absolute path) More...
|
|
void | MergeInto (LanguageDefinition parent) |
| Merges this language into the specified parent language. Will only override entries/font if overwrite is true. More...
|
|
void | RemoveTranslation (string input) |
| Removes a translation from the dictionary. More...
|
|
void | Serialize (string path, bool localPath=true) |
| Serializes the language to the specified path (path under GameData by default, else set localPath false for absolute path) More...
|
|
void | SerializeUntranslated (string path, bool localPath=true) |
| Serializes the language's untranslated words to the specified path (path under GameData by default, else set localPath false for absolute path) More...
|
|
string | TranslateWithFormat (string baseString, params object[] args) |
| Constructs a translation from an input string and a set of arguments using string.Format NOTE: the number of arguments must match the {0}, {1}, etc in the translated form of the input. More...
|
|
string | Translation (string input) |
| Returns a translation of the input term (or the input term itself if no translation) Will store in untranslated if flag is set. More...
|
|
Holds a lanugage for localisation: includes a dictionary (string->string) and a font. Can be saved and loaded from XML.
KSP.UI.Language.LanguageDefinition.LanguageDefinition |
( |
| ) |
|
|
inline |
KSP.UI.Language.LanguageDefinition.LanguageDefinition |
( |
string |
langName, |
|
|
string |
fontName |
|
) |
| |
|
inline |
Creates an empty language with given name and font.
- Parameters
-
langName | Name of the language |
fontName | Name of the font |
KSP.UI.Language.LanguageDefinition.LanguageDefinition |
( |
string |
path, |
|
|
bool |
localPath = true |
|
) |
| |
|
inline |
Loads language from specified path (path under GameData by default, else set localPath false for absolute path)
- Parameters
-
path | path to the XML to save |
localPath | Defaults true, if false use as absolute path |
void KSP.UI.Language.LanguageDefinition.AddTranslation |
( |
string |
input, |
|
|
string |
output |
|
) |
| |
|
inline |
Adds a translation to the dictionary.
- Parameters
-
void KSP.UI.Language.LanguageDefinition.Deserialize |
( |
string |
path, |
|
|
bool |
localPath = true |
|
) |
| |
|
inline |
Loads language from specified xml file (path under GameData by default, else set localPath false for absolute path)
- Parameters
-
path | path to the XML file to load |
///
- Parameters
-
localPath | Defaults true, if false use as absolute path |
< get font
< reload from helper
< GC should automatically dispose of the other thing.
string KSP.UI.Language.LanguageDefinition.GetFullPath |
( |
string |
path | ) |
|
|
inlineprotected |
Merges this language into the specified parent language. Will only override entries/font if overwrite is true.
- Parameters
-
void KSP.UI.Language.LanguageDefinition.RemoveTranslation |
( |
string |
input | ) |
|
|
inline |
Removes a translation from the dictionary.
- Parameters
-
void KSP.UI.Language.LanguageDefinition.Serialize |
( |
string |
path, |
|
|
bool |
localPath = true |
|
) |
| |
|
inline |
Serializes the language to the specified path (path under GameData by default, else set localPath false for absolute path)
- Parameters
-
path | path to the XML to save |
localPath | Defaults true, if false use as absolute path |
void KSP.UI.Language.LanguageDefinition.SerializeUntranslated |
( |
string |
path, |
|
|
bool |
localPath = true |
|
) |
| |
|
inline |
Serializes the language's untranslated words to the specified path (path under GameData by default, else set localPath false for absolute path)
- Parameters
-
path | path to the XML to save |
localPath | Defaults true, if false use as absolute path |
string KSP.UI.Language.LanguageDefinition.TranslateWithFormat |
( |
string |
baseString, |
|
|
params object[] |
args |
|
) |
| |
|
inline |
Constructs a translation from an input string and a set of arguments using string.Format NOTE: the number of arguments must match the {0}, {1}, etc in the translated form of the input.
- Parameters
-
baseString | the base string to be translated |
args | the arguments for string.Format |
- Returns
- translated constructed string
< translate the arguments
string KSP.UI.Language.LanguageDefinition.Translation |
( |
string |
input | ) |
|
|
inline |
Returns a translation of the input term (or the input term itself if no translation) Will store in untranslated if flag is set.
- Parameters
-
input | the term to translate |
- Returns
- translated form of input
< FIXME should we default to something else?
bool KSP.UI.Language.LanguageDefinition.overwrite = false |
DO NOT USE. For internal use only, but public so it's serializable.
DO NOT USE. For internal use only, but public so it's serializable.
string KSP.UI.Language.LanguageDefinition.Font |
|
getset |
The font the language uses.
string KSP.UI.Language.LanguageDefinition.Name |
|
getset |
bool KSP.UI.Language.LanguageDefinition.StoreUntranslated |
|
getset |
Do we store any translation calls that fail to find translations?
The documentation for this class was generated from the following file: