Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


Warning

Please refer to this page for further details on Internationalization.THIS PAGE IS ARCHIVED AND AVAILABLE ONLY FOR REFERENCE PURPOSES. PLEASE REFER TO THIS PAGE FOR MORE DETAILS ON TRANSLATING BAHMNI


Info
titleFuture Process

An upcoming Bahmni release will feature shared translations, done online. See Translating Bahmni for this new approach. If you are planning a future Bahmni deployment, you should look at starting this shared translation process now.

The instructions on this page apply to current Bahmni installations, as well as local overrides of shared translations that eventually are included in the Bahmni product.

Context:

Internationalization provides a way to make the application available in multiple languages.  Internationalization is also referred as i18n because there are 18 characters between 'i' and 'n' in the word 'internationalization'.  Bahmni provides internationalization, in way that you have to do minimal changes to the bahmni_config.

Adding a locale:

Enabling support for a locale:

OpenMRS uses a setting called "Allowed List" to keep track of the list of supported locales. You can see that setting at Administration -> Settings - > Locale in the OpenMRS home page. This setting contains a comma separated list of locales. If you want to add a locale just add it after the last one. Remove any locale which you don't wish to support.  Example : en, es, fr, it, pt.

InfoOne can see the list of supported locales as a drop down list on

the

Bahmni home page.

From 0.89, you can see the corresponding language for the locale code if you configure the mapping in the file localeLanguages.json which you can find in the path / bahmni_config/openmrs/apps/home

Code Block
languagejs
titleSample configuration
{"locales": [ {"code": "en", "nativeName": "English"},
              {"code": "es", "nativeName": "Español"},
              {"code": "fr", "nativeName": "Français"},
              {"code": "it", "nativeName": "Italiano"},
              {"code": "pt", "nativeName": "Português"}]
}
Image Removed TipIf you want to change the locale,  you have to select the locale in the Bahmni home page itself, before logging in

.

Adding files required for the locale:

There is a folder called i18n in the openmrs folder inside the bahmni_config folder which contains all the files required for the locale. The directory structure reflects the various modules in the application. Each module has JSON files supporting different locales.

Info

For example the file locale_en.json supports the English language.


Tip

So, if you want to add support for the Russian language, you just need to add a file named locale_ru.json in all modules.

What actually these JSON files contain? :

These JSON files contain a JSON object containing key, value pairs. All the keys are internally mapped to the text that is displayed in the module's web page to which the JSON file belongs to.

To get started, you can just copy existing locale file and rename it.

Tip

For example copy locale_en.json file and rename it as locale_ru.json. Then, translate the text values in that file and replace them with text in your language.

Performing complete translation:

bahmni_config folder only contains keys for the text that appears inside the bahmni_config folder only. Bahmni application by default supports English locale. It comes bundled with locale_en.json files for all modules. These files contain keys that correspond to the text inside the application. So, an implementer can't directly access those files. Instead you can access them at https://github.com/Bhamni/openmrs-module-bahmniapps/tree/master/ui/app/i18n. Copy all keys corresponding to the module into the locale file and translate all those text values also.


Tip
titleOn this Page

Table of Contents