Personal tools

OpenEMR Internationalization Configuration

From OpenEMR Project Wiki

(Difference between revisions)
Jump to: navigation, search
(Created page with '<span style="color:red;">NOTE THAT IF YOU ARE INTERESTING IN HELPING WITH TRANSLATIONS, PLEASE CLICK HERE FOR MORE INFORMATION</span>…')
Line 1: Line 1:
-
__TOC__
+
<span style="color:red;">NOTE THAT IF YOU ARE INTERESTING IN HELPING WITH TRANSLATIONS, PLEASE CLICK [[OpenEMR Internationalization Development|HERE]] FOR MORE INFORMATION</span>
-
= <center> OpenEMR Internationalization Documentation </center> =
 
-
== Language Translations Settings ==
+
'''OpenEMR Internationalization Documentation'''
-
These are configured in [[Administration_Globals#Locale|Administration->Globals->Locale]].
+
I.    Multi-Language Tool<br>
-
Mainly, you can configure the default language and
+
II.  Official OpenEMR Language Translations<br>
 +
III.  Language Translations Setting<br>
 +
IV.  Developer Instructions
 +
 
 +
 
 +
I. Multi Language Tool.
 +
 
 +
This is the Language Administration page in OpenEMR. This is where you can
 +
customize languages and language definitions. You can add new languages,
 +
,add new English Constants, and modify/add language definitions. (Please note
 +
you can also enter your translations into the official OpenEMR Language
 +
Translation GoogleDoc spreadsheet; see section II. for details)
 +
 
 +
  The following is an explanation of the options in this tool:
 +
    Add Language: You get a box to enter a new language.
 +
    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.
 +
    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. 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.
 +
 
 +
 
 +
II. Official OpenEMR Language Translations
 +
 
 +
The OpenEMR language translations are built from a collaborative Google
 +
Doc. If you would like to add a language or help with a current language,
 +
please contact us.  You could then enter your translations into this
 +
spreadsheet, which will then become a permanent part of OpenEMR. This
 +
process has become very streamlined with a fast turnaround time, so
 +
we would suggest you enter data on this collaborative spreadsheet rather
 +
than entering into your local OpenEMR installation only. To download the
 +
most uptodate set of translations, visit our wiki at oemr.org.
 +
 
 +
 
 +
III. Language Translations Setting
 +
 
 +
These are configured in the openemr/interface/globals.php
 +
file. Mainly, you can configure the default language and
what is displayed in the login language selection menu (you
what is displayed in the login language selection menu (you
can also disable this menu). There are also more advanced
can also disable this menu). There are also more advanced
setting to turn off certain parts of the translation
setting to turn off certain parts of the translation
-
engine. Please see the Locale section of the
+
engine. Please see the Language section of
-
[[Administration_Globals#Locale|Administration Globals]] wiki page for more details.
+
openemr/interface/globals.php for more details.
-
== Official OpenEMR Language Translations ==
 
-
The OpenEMR language translations are built from a [http://spreadsheets.google.com/ccc?key=0AtTW60zHo6HzcGg0UE9JMGJHM1NsSWpuYkh0Snl4Q0E&hl=en collaborative Google Doc]. If you would like to add a language or help with a current language,
+
IV. Developer Instructions
-
please see the [[OpenEMR Internationalization Translator Guide]] wiki page for more details . You could then enter your translations into this
+
 
-
spreadsheet, which will then become a permanent part of OpenEMR. This
+
The translation is done by the xl() custom function, which can be found
-
process has become very streamlined with a fast turnaround time(daily builds), so
+
at openemr/library/translation.inc.php.
-
we would suggest you enter data on this collaborative spreadsheet rather
+
Its semantics are very simple.
-
than entering into your local OpenEMR installation only. Note that the
+
 
-
translations sets are built daily. [[Install Translations|The most uptodate set of
+
xl (string,'r',string-prepend,string-append)
-
translations can be downloaded here]].
+
 
 +
Which with examples means:
 +
 
 +
<pre>xl ('translate this')</pre>
 +
 
 +
By default the function will return (after all, is a function) the translation.
 +
 
 +
First it uses the LANGUAGE constant defined to pick the translation.
 +
 
 +
Second it goes for the translation, if none is found, then the same string entered is used and returned as is.
 +
 
 +
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.
 +
 
 +
i.e.
 +
<pre>xl ('translate this','e')</pre>
 +
 
 +
But if you are already within another function, then you want the function to return something.
 +
 
 +
i.e.
 +
<pre>echo ("this and" . xl('translate this') . "that too");</pre>
 +
 
 +
The third and fourth optional arguments are strings to be prepend and appended respectively.
 +
 
 +
i.e.
 +
<pre>xl ('translate this','e','<b>','</b>');</pre>
 +
 
 +
will echo '''this translated'''
-
== Multi Language Tool. ==
+
If you want only something to be appended in the a return, then you must supply empty second and third arguments.
-
This is the Language Administration page in OpenEMR (Administration->Language). This is where you can customize languages and language definitions. You can add new languages,
+
i.e.
-
,add new English Constants, modify/add language definitions, and synchronize your local changes back after importing the official OpenEMR language translation sets.
+
<pre>xl ('translate this','','','<br>');</pre>
-
The following is an explanation of the options in this tool:
+
will echo this translated
-
===Add Language===
+
-
:You get a box to enter a new language.
+
-
===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. The "constant" string can be literally what you want to say or a shorter reference to it.
+
-
===Edit Definitions===
+
There are also wrappers to the xl() function that are used infrequently in specific situations. Please
-
: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. 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.
+
refer to openemr/library/translation.inc.php for more details.
-
===Manage Translations===
 
-
:This tool allows you to re-synchronize your local language modifications after importing an official released set of OpenEMR translations.
 
-
[[Category:User Guide]][[Category:User Guide 4.1.0]][[Category:Translator Guide]][[Category:Configuration Guide]][[Category:Internationalization]]
+
Author:<br>
 +
Brady Miller<br>
 +
brady@sparmy.com<br>
 +
http://www.bradymd.com/appliance/

Revision as of 02:26, 8 November 2009

NOTE THAT IF YOU ARE INTERESTING IN HELPING WITH TRANSLATIONS, PLEASE CLICK HERE FOR MORE INFORMATION


OpenEMR Internationalization Documentation

I. Multi-Language Tool
II. Official OpenEMR Language Translations
III. Language Translations Setting
IV. Developer Instructions


I. Multi Language Tool.

This is the Language Administration page in OpenEMR. This is where you can customize languages and language definitions. You can add new languages, ,add new English Constants, and modify/add language definitions. (Please note you can also enter your translations into the official OpenEMR Language Translation GoogleDoc spreadsheet; see section II. for details)

 The following is an explanation of the options in this tool:
   Add Language: You get a box to enter a new language.
   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.
   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. 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.


II. Official OpenEMR Language Translations

The OpenEMR language translations are built from a collaborative Google Doc. If you would like to add a language or help with a current language, please contact us. You could then enter your translations into this spreadsheet, which will then become a permanent part of OpenEMR. This process has become very streamlined with a fast turnaround time, so we would suggest you enter data on this collaborative spreadsheet rather than entering into your local OpenEMR installation only. To download the most uptodate set of translations, visit our wiki at oemr.org.


III. Language Translations Setting

These are configured in the openemr/interface/globals.php file. Mainly, you can configure the default language and what is displayed in the login language selection menu (you can also disable this menu). There are also more advanced setting to turn off certain parts of the translation engine. Please see the Language section of openemr/interface/globals.php for more details.


IV. Developer Instructions

The translation is done by the xl() custom function, which can be found at openemr/library/translation.inc.php. Its semantics are very simple.

xl (string,'r',string-prepend,string-append)

Which with examples means:

xl ('translate this')

By default the function will return (after all, is a function) the translation.

First it uses the LANGUAGE constant defined to pick the translation.

Second it goes for the translation, if none is found, then the same string entered is used and returned as is.

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.

i.e.

xl ('translate this','e')

But if you are already within another function, then you want the function to return something.

i.e.

echo ("this and" . xl('translate this') . "that too");

The third and fourth optional arguments are strings to be prepend and appended respectively.

i.e.

xl ('translate this','e','<b>','</b>');

will echo this translated

If you want only something to be appended in the a return, then you must supply empty second and third arguments.

i.e.

xl ('translate this','','','<br>');

will echo this translated

There are also wrappers to the xl() function that are used infrequently in specific situations. Please refer to openemr/library/translation.inc.php for more details.


Author:
Brady Miller
brady@sparmy.com
http://www.bradymd.com/appliance/