3 OpenEMR Internationalization Documentation
6 II. Official OpenEMR Language Translations
7 III. Language Translations Setting
8 IV. Developer Instructions
10 I. Multi Language Tool.
12 This is the Language Administration page in OpenEMR. This is where you can
13 customize languages and language definitions. You can add new languages,
14 ,add new English Constants, and modify/add language definitions. (Please note
15 you can also enter your translations into the official OpenEMR Language
16 Translation GoogleDoc spreadsheet; see section II. for details)
18 The following is an explanation of the options in this tool:
19 Add Language: You get a box to enter a new language.
20 Add Constant: You get a box to add a new string to be used in the translation
21 function, this one should be used only if you know what you are
22 doing, mostly, if you added some custom programming with new
23 text output. The
"constant" string can be literally what you
24 want to say or a shorter reference to it.
25 Edit Definitions: English is used as the reference language, if you click
26 the English label you'll get a set of all constants and
27 the English definitions at the side. If no definition is
28 loaded yet for a given constant then a blank box is shown,
29 by entering a definition and clicking
"Load Definition"
30 you save whatever changes you made. If you select other
31 language than English, you get a set of all constants,
32 the English definition at the side, and an input box
33 to enter/modify the definition in the selected language.
34 Manage Translations: This tool allows you to re-synchronize your
35 local language modifications after importing
36 an official released set of OpenEMR translations.
39 II. Official OpenEMR Language Translations
41 The OpenEMR language official translation sets are built from a
42 collaborative Google Doc. If you would like to add a language or help
43 with a current language, please contact us. You could then enter your
44 translations into this spreadsheet, which will then become a permanent
45 part of OpenEMR. This process has become very streamlined with a fast
46 turnaround time, so we would suggest you enter data on this collaborative
47 spreadsheet. Note that the translations sets are built daily; to download
48 the most uptodate set of translations, visit our documentation at open-emr.org .
51 III. Language Translations Setting
53 These are configured in the Administration-
>Globals interface.
54 Mainly, you can configure the default language and what is
55 displayed in the login language selection menu (you
56 can also disable this menu). There are also more advanced
57 setting to turn off certain parts of the translation
58 engine. Please see the section of Administration-
>Globals for more
62 IV. Developer Instructions
64 The translation is done by the xl() custom function, which can be found
65 at openemr/library/translation.inc.php.
66 Its semantics are very simple.
70 Which with examples means:
74 By default the function will return the translation.
76 First it uses the LANGUAGE constant defined to pick the translation.
78 Second it goes for the translation, if none is found, then the same string entered is used and returned as is.
80 Another example of use includes:
82 echo (
"this and " . xl('translate this') .
" that too");
84 Further details and rules on use can be found on the wiki here:
85 https://open-emr.org/wiki/index.php/Development_Policies#Internationalization
87 There are also wrappers to the xl() function that are used infrequently in specific situations. Please
88 refer to openemr/library/translation.inc.php for more details.