I’m convinced that distributions can set a default locale in O3 (after all, surely that’s how Mekom has been able to have an entirely Khmer distro in Cambodia, and ICRC entirely French and Spanish distros elsewhere) - but @eudson and @dagimm just asked me about this, and I couldn’t find the explicit guidance in our current O3 frontend i18n guidance.
We define the default language in the global property default_locale.
Specifies the default locale. You can specify both the language code(ISO-639) and the country > code(ISO-3166), e.g. ‘en_GB’ or just country: e.g. ‘en’
To be honest didn’t check on our O3 instance ( only tested for O2 instance) but pretty sure it should be supported for O3
We probably should make O3 respect that property. Currently, we load the locale from:
The querystring (?lang=fr)
The HTML Tag (see below)
The user’s browser (browser request different languages a user can configure via the Accept-Language; the first entry is usually the browser’s default language).
For the HTML tag, we have a setting, part of the build config, called defaultLocale that can be used to specify the default locale.
Once a user logs in, we set the locale based on the backend settings, which should use the GP @frederic.deniger mentions.
Despite the HTML tag thing, by design, this isn’t something you should need to configure in O3 differently from previous versions of OpenMRS. The HTML Tag was just there to deal with the case where the backend is unreachable.
Please can you tell me where should I add : ?lang=fr.
Also , do I need to set the default locale in all 4 places? querystrin and html and browser and the config file? or one of them is enough?
To set the default locale, its enough to set the default_localein the global properties like this example which sets the default locale to French -
<config>
<globalProperties>
<globalProperty>
<property>default_locale</property>
<value>fr</value>
<description>Specifies the default locale. You can specify both the language code(ISO-639) and the country code(ISO-3166), e.g. 'en_GB' or just country: e.g. 'en'</description>
</globalProperty>
</globalProperties>
</config>
thanks for the reply…
I have done the same change you put to i18n-core_demo.xml under : server1/configuration/globalproperties/referenceapplication-demo
however, nothing has changed at O3 ui nor in admin ui … what could be the issue?
UPDATE: it seems an cache issue..
resolved by testing using other browser, however, it was only applied to the login page .. everything else is the same.