Doc tweaks:
[lhc/web/wiklou.git] / docs / language.txt
1 language.txt
2
3 The Language object handles all readable text produced by the software. The most
4 used function is getMessage(), usually called with the wrapper function wfMsg()
5 which calls that method on the global language object. It just returns a piece
6 of text given a text key. It is recommended that you use each key only
7 once--bits of text in different contexts that happen to be identical in English
8 may not be in other languages, so it's better to add new keys than to reuse them
9 a lot. Likewise, if there is text that gets combined with things like names and
10 titles, it is better to put markers like "$1" inside a piece of text and use
11 str_replace() than to compose such messages in code, because their order may
12 change in other languages too.
13
14 While the system is running, there will be one global language object, which
15 will be a subtype of Language. The methods in these objects will return the
16 native text requested if available, otherwise they fall back to sending English
17 text (which is why the LanguageEn object has no code at all--it just inherits
18 the English defaults of the Language base class).
19
20 The names of the namespaces are also contained in the language object, though
21 the numbers are fixed.