Created attachment 824575 [details] Some texts not in English Description of problem: Installation of dashuilder in a non-english OS (JVM default locale non-english). The OS language must be one of the languages supported by dashbuilder i.e: Spanish (es) German (de) French (fr) Chinese (zh) Japanese (ja) Portuguese (pt) Once logged into the UI if the user selected the "English" language from the language selector menu some texts are displayed in the OS system language and not in English. For instance, Showcase>Administration>Data providers. Version-Release number of selected component (if applicable): How reproducible: Always. Steps to Reproduce: 1. Install on a host with a non-english supported language (or change the JVM default locale) 2. Do login as admin, select the English language. 3. Go to Showcase>Administration>Data providers. Actual results: Some texts displayed in the default OS language not in English. Expected results: All the texts displayed in English. Additional info:
This issue is caused because the app's resource bundles in English are the default ones (with no language prefix: messages.properties). One work-around to deal with this is to set the JVM default locale to English before running the app. In fact, we think this is the best approach since the app assumes English is set as the default.
We have found the cause and a possible solution: Cause ===== - The default Oracle JVM ResourceBundle class implementation for the method getBundle(...) is based on: 1.- Obtain the bundle using the locale argument 2.- If the bundle for the locale argument does not exist, use the fallback bundle. In both JDK 6/7 the default fallback bundle is obtained using the default JVM locale. 3.- If the bundle for default jvm locale is not found, use the global one. - In the whole dashbuilder module there is no bundles for "en" region (the global ones are the english ones). -> So, if you run the dashbuilder web application using the Spanish locale and change it using the UI (language combo selector) to English, as the resource bundle for "en" is not found and by the other hand the resource bundle for default jvm locale ("ES") is found, the returned language will be Spanish. -> This error only happens to static bundles (existing properties files in the module). For all dynamic texts introduced by the user or by the pre-installed workspaces it works fine, as they are not resource bundles, are database field. This is the reason why some texts are in english and some in spanish when reproducing this issue. Solution ======== Change the behavior of the fallback bundle for ResourceBundle class implementation. For more information see http://docs.oracle.com/javase/6/docs/api/java/util/ResourceBundle.Control.html. The idea is to encapsulate all dashbuilder module calls to ResourceBundle methods into the org.jboss.dashboard.LocaleManager class. Then, delegate to the JDK ResourceBundle but using a different ResourceBundle.Control implementation. The impl to use is ResourceBundle.NoFallbackControl. This is the first approach, so the solution details are not commented yet.
Fixed. The solution has been to encapsulate all calls to ResourceBundle#getBundle method into a new method in org.jboss.dashboard.LocaleManager#getBundle. This encapsulation uses a NoFallbackControl implementation for ResourceBundle.Control instance. For jsp files, a new custom i18n tag class has been created to encapsulate the same logic. Commits on master ================= - https://github.com/droolsjbpm/dashboard-builder/commit/24206ff35f6f0c45d2baf7dde23f6ae9e9864711 - https://github.com/droolsjbpm/jbpm-dashboard/commit/9477b6b145b2962cc5dd4556a8a50f3392fc9e80 Commits on 6.0.x ================= - https://github.com/droolsjbpm/dashboard-builder/commit/b9d98659e9d793b03faf4a964e945bf1ec85aaee - https://github.com/droolsjbpm/jbpm-dashboard/commit/c38bed5a765974cc8a20f338938ff4c6d4b3b61c
Uuuups - wrong field.
Reproduced on Spanish OS (Fedora 20) and BPMS 6.0.0.ER5 Verified on Spanish OS (Fedora 20) and BPMS 6.0.0.ER7