You can force the locale by removing other locales support. This is done in the
deployment-fragment.xml file of your plugin.
<require>org.nuxeo.ecm.platform.lang.ext</require> <extension target="faces-config#APPLICATION_LOCALE" mode="replace"> <locale-config> <default-locale>en_US</default-locale> <supported-locale>en_US</supported-locale> </locale-config> <message-bundle>messages</message-bundle> </extension>
mode="replace" attribute will replace all the previously contributed
So you have to carefully make your plugin being deployed after any other bundle contributing a
locale-config. In the above sample, this is ensured by the
This configuration applies on JSF pages and will not change the default locale on the login page which only depends on the browser configuration.
If you'd like to force locale on the login page, you should override the page at
/login.jsp and force the locale there, by adding the following line at the beginning of the file, just after the
<html> tag, for instance:
<fmt:setLocale value="fr" />