more bug fixes
[openemr.git] / interface / language / lang.info.html
blobba291542b462af9ceda16db122e3de1f818220ad
1 <pre>
3 Multi Language Tool.
5 This module has very few components to care about.
7 The first one is the following lines you can find at globals.php
9 //Language Control Section (will add toggling)
10 //English:1, Swedish:2, Spanish:3, German:4,
11 define (LANGUAGE,1);
13 By changing the number, you change the default language.
14 At a click language toggling capabilities will be added in the future.
16 The second thing is the module itself.
17 By default we have English, Swedish, and Spanish loaded as languages.
18 But not all the translation is done yet.
20 The options are.
21 Add Language: You get a box to enter a new language.
23 Add Constant: You get a box to add a new string to be used in the translation function, this one should be used only if you know what you are doing, mostly, if you added some custom programming with new text output. The "constant" string can be literally what you want to say or a shorter reference to it.
25 Edit Definitions: English is used as the reference language, if you click the English label you'll get a set of all constants and the English definitions at the side. If no definition is loaded yet for a given constant then a blank box is shown, by entering a definition and clicking "Load Definition" you save whatever changes you made.
27 If you click other label than English, you get a set of all constants, the English definition at the side, and an input box to enter/modify the definition in the selected language.
29 The translation is done by the xl() custom function.
30 Its semantics are very simple.
32 xl (string[,'r'[,string prepend[,string append]])
34 Which with examples means:
36 xl ('translate this')
38 By default the function will return (after all, is a function) the translation.
40 First it uses the LANGUAGE constant defined to pick the translation.
42 Second it goes for the translation, if none is found, then the same string entered is used and returned as is.
44 The first optional and only argument is 'e' which stands for echo. Use it if you want the function to echo the translated result instead of returning it.
46 i.e.
47 xl ('translate this','e')
49 But if you are already within another function, then you want the function to return something.
51 i.e.
52 echo ("this and".xl ('translate this')."that too");
54 The third and fourth optional arguments are strings to be prepend and appended respectively.
56 i.e.
57 xl ('translate this','e','&#60b>',&#60/b>);
59 will echo
60 &#60b>this translated&#60/b>
62 If you want only something to be appended in the a return, then you must supply empty second and third arguments.
64 i.e.
65 xl ('translate this','','',&#60br>);
66 will echo
67 this translated&#60br>
69 </pre>