3 OpenEMR Internationalization Documentation
6 II. Official OpenEMR Language Translations
7 III. Language Translations Setting
8 IV. Developer Instructions
9 V. Configure the Customization Log
11 I. Multi Language Tool.
13 This is the Language Administration page in OpenEMR. This is where you can
14 customize languages and language definitions. You can add new languages,
15 ,add new English Constants, and modify/add language definitions. (Please note
16 you can also enter your translations into the official OpenEMR Language
17 Translation GoogleDoc spreadsheet; see section II. for details)
19 The following is an explanation of the options in this tool:
20 Add Language: You get a box to enter a new language.
21 Add Constant: You get a box to add a new string to be used in the translation
22 function, this one should be used only if you know what you are
23 doing, mostly, if you added some custom programming with new
24 text output. The
"constant" string can be literally what you
25 want to say or a shorter reference to it.
26 Edit Definitions: English is used as the reference language, if you click
27 the English label you'll get a set of all constants and
28 the English definitions at the side. If no definition is
29 loaded yet for a given constant then a blank box is shown,
30 by entering a definition and clicking
"Load Definition"
31 you save whatever changes you made. If you select other
32 language than English, you get a set of all constants,
33 the English definition at the side, and an input box
34 to enter/modify the definition in the selected language.
35 Manage Translations: This tool allows you to re-synchronize your
36 local language modifications after importing
37 an official released set of OpenEMR translations.
38 If your using OpenEMR version
3.2.0, then go to
39 section V. and follow instruction there in order
40 to configure this function.
43 II. Official OpenEMR Language Translations
45 The OpenEMR language official translation sets are built from a
46 collaborative Google Doc. If you would like to add a language or help
47 with a current language, please contact us. You could then enter your
48 translations into this spreadsheet, which will then become a permanent
49 part of OpenEMR. This process has become very streamlined with a fast
50 turnaround time, so we would suggest you enter data on this collaborative
51 spreadsheet. To download the most uptodate set of translations, visit
55 III. Language Translations Setting
57 These are configured in the interface/globals.php file.
58 Mainly, you can configure the default language and what is
59 displayed in the login language selection menu (you
60 can also disable this menu). There are also more advanced
61 setting to turn off certain parts of the translation
62 engine. Please see the section of the interface/globals.php
63 file for more details.
66 IV. Developer Instructions
68 The translation is done by the xl() custom function, which can be found
69 at openemr/library/translation.inc.php.
70 Its semantics are very simple.
72 xl (string,'r',string-prepend,string-append)
74 Which with examples means:
78 By default the function will return (after all, is a function) the translation.
80 First it uses the LANGUAGE constant defined to pick the translation.
82 Second it goes for the translation, if none is found, then the same string entered is used and returned as is.
84 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.
87 xl ('translate this','e')
89 But if you are already within another function, then you want the function to return something.
92 echo (
"this and" . xl('translate this') .
"that too");
94 The third and fourth optional arguments are strings to be prepend and appended respectively.
97 xl ('translate this','e','&#
60b
>','&#
60/b
>');
100 &#
60b
>this translated&#
60/b
>
102 If you want only something to be appended in the a return, then you must supply empty second and third arguments.
105 xl ('translate this','','','&#
60br
>');
107 this translated&#
60br
>
109 There are also wrappers to the xl() function that are used infrequently in specific situations. Please
110 refer to openemr/library/translation.inc.php for more details.
113 V. Configure the Customization Log (for OpenEMR version
3.2)
115 This will require a minor modification to a page and a new mysql table
118 STEP
1: Edit interface/language/language.php at top of
119 the script, set the $enable_custom_language_logging variable to true.
121 STEP
2: Within OpenEMR, go to Administration-
>Database screen. Then
122 click 'openemr' on top left of phpmyadmin screen. Then click 'SQL' tab
123 on the screen. Then copy/paste below text, and click 'Go' button:
124 CREATE TABLE lang_custom (
125 lang_description varchar(
100) NOT NULL default '',
126 lang_code char(
2) NOT NULL default '',
127 constant_name varchar(
255) NOT NULL default '',
128 definition mediumtext NOT NULL default ''