On the screenshot above, the labels that appear correctly translated are either:
present in locale_km.json file. This is the case for labels: ស្រាវជ្រាវ (e) (Search) and បង្កើតថ្មី (N) (Create New) at the top of the screen. locale_km.json file is loaded and keys are correctly looked up.
or labels of OpenMRS metadata already translated by exti18n module. Labels លេខសម្គាល់ OpenMRS and ឈ្មោះ-ខ្មែរ . Those are not related to Bahmni at all, this is all server-side work (as you know)
The keys not processed though are the ones provided in bahmniapps_km.json (same with bahmniapps_en.json or any locale). It seems like the file has to be named locale_xx.json
I will try to provide you with a simpler example of one key per file and attach the files here.
Well, this has been a wild goose chase, and I am kicking myself for reading your note more carefully.
When I said you can put as many files suffixed with .json, I didn’t actually mean that the locale file name can be anything. To load the files, we need to know how they are going to be named by a convention.
The convention is pretty simple,
<location of bahmni_config>/openmrs/i18n/<app name>/locale_<code>.json
The patterns of the file name is locale_<code>.json. This code can be anything “en”, “es” etc etc. As long as you configured the supported locales by the right codes in openmrs admin.
You can not add a bahmniapps_en.json, because Bahmni doesn’t know what file name is used.
Thanks. Sorry for not being clear enough on this one.
Do you think we could improve this by supporting a certain pattern that would allow to load multiple files, for one locale? For instance any files in the folder and named as <any-prefix>_locale_<i18n-code>.json
From the thread, I don’t see how one can really provide translation of Bahmni Apps for a given language without forking Bahmni Apps (which I would not advise), so providing the i18n files in the config seems a not so bad idea in the end.
You can just add your locale files, or replace existing ones - don’t you?
The question with the translation packs is also about preference - although angular-translate module (pascalprecht.translate) that we are using does provide merging. The question comes up whats the order of loading!