Changes between Version 2 and Version 3 of code/doc/Language
- Timestamp:
- Feb 27, 2008, 6:25:31 PM (17 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
code/doc/Language
v2 v3 5 5 The [wiki:Language] is a [wiki:singleton] that handles strings in different languages. It replaces hardcoded strings by labeled strings, where the coder only uses the label and the [wiki:Language] searches for the localised string in the [wiki:ConfigValueContainer configured] language-file. Every string has a fallback-value that is used if there is no localised version or no language was configured. The language can be configured by changing the ''language_'' entry in the [wiki:ConfigValueContainer config-file]. 6 6 7 A new language-entry can be added with the !AddLanguageEntry(label, fallbackstring) macro and the localisation can be retrieved with !GetLocalisation(label). 8 7 9 All labels and the corresponding fallback strings are written to ''translation_default.lang''. If the fallback-string gets changed in the code, ''translation_default.lang'' changes too. If a new label gets added in the code, it gets added to ''translation_default.lang''. You can't change labels or fallback-strings in this file, it will be set back to the default. You can use ''translation_default.lang'' as a sample for a new language file. See [wiki:Language#Addinganewlanguage] for more informations about this. 10 11 == Macros == 12 13 * '''!AddLanguageEntry('''''label''''', '''''fallbackstring''''')''': Adds a new entry to the [wiki:Language] by defining a unique label and a fallback string that gets used in case there is no localisation. 14 * '''!GetLocalisation('''''label''''')''': Returns the localisation of the given label. 8 15 9 16 == Functions ==