added UPGRADING tips
[mir.git] / doc / INTERNATIONALIZATION.howto
1 MIR INTERNATIONALIZATION HOWTO
2 ----------------------------------------------------------------
3
4 this short howto explains how to use the internationalization 
5 features of mir and how you can translate mir to other 
6 languages. this is actually very easy:
7
8
9 * properties files (step 1)
10
11 add a new file to the bundles/ directory. it should
12 be called exactly like the other files there, except
13 for the language code, which is the part after the underscore.
14 at the moment these files are called 'admin_XX.properties', so
15
16 admin_de.properties contains the strings for the german language
17 admin_en.properties is the one for english.
18 admin.properties is always used as a fallback and contains imc
19 spcific information at the moment (this should probably change)
20
21 the correct language code for your language can be found at
22 http://www.w3.org/WAI/ER/IG/ert/iso639.htm, for example.
23
24
25 * translation (step 2)
26
27 the files just contain key and value pairs of the form 
28 key=value. if a value contains something like {0}, {1}, and so
29 on, this means, that these placeholders are replaced when the
30 phrase is used. this is for example used for the key 
31 show_from_to=showing from {0} to {1}. {0} and {1} get replaced 
32 with the number of the first and the last record shown.
33
34 in you new file (say admin_es.properties) you translate every key
35 into the appropriate phrase in your language.
36
37
38 * adding keys to templates
39
40 you can define additional keys just by adding them to the 
41 properties file and by referncing them in the freemaker template
42 with ${lang("keyname")}. you should do that every time you need
43 a language specific string!
44
45
46 * renaming keys
47
48 some keys might not have a perfectly fitting name at the moment.
49 if you want to rename a key, please take care that you rename it
50 in ALL properties files and ALL templates. take care.
51
52 ----------------------------------------------------------------
53 27.3.2002, br1