Details
-
Type:
Bug
-
Status: Closed (View Workflow)
-
Priority:
Critical
-
Resolution: Done
-
Affects Version/s: None
-
Fix Version/s: 3.0.0.CR2
-
Labels:None
-
Git Pull Request:
Description
#
{bundles.messages.MyKey}doesnt return the correct properties file after firing locale event and changed the locale of user. @Inject @Client Locale locale returns proper value after changing locale but bundles messages returns values from jdk locale. I will add non working example and I working example with helper class later once the repository is up again.
Gliffy Diagrams
-
Hide
- seam-i18n.zip
- 14 kB
- Sebastian Sachtleben
-
- src/main/java/.../i18n/LocaleSelector.java 1 kB
- src/main/java/.../i18n/LocaleUtils.java 0.6 kB
- src/main/java/.../i18n/MessageBundle.java 0.9 kB
- src/main/resources/messages.properties 0.3 kB
- src/main/.../messages_de.properties 0.3 kB
- src/main/.../messages_en.properties 0.3 kB
- src/main/.../META-INF/seam-beans.xml 0.5 kB
- src/main/webapp/css/style.css 0.5 kB
- src/main/webapp/home.xhtml 1 kB
- src/main/webapp/images/flag_de.png 0.4 kB
- src/main/webapp/images/flag_en.png 0.7 kB
- src/main/webapp/index.html 0.1 kB
- src/main/webapp/layout/main.xhtml 0.8 kB
- src/main/webapp/WEB-INF/faces-config.xml 0.4 kB
- src/main/webapp/WEB-INF/web.xml 2 kB
- .classpath 0.5 kB
- .project 0.5 kB
- pom.xml 14 kB
- .settings/org.eclipse.jdt.core.prefs 0.3 kB
- .settings/org.maven.ide.eclipse.prefs 0.2 kB
-
Hide
- seam-i18n-problem.zip
- 13 kB
- Sebastian Sachtleben
-
- .classpath 0.6 kB
- .project 0.6 kB
- pom.xml 14 kB
- .settings/org.eclipse.jdt.core.prefs 0.3 kB
- .settings/org.maven.ide.eclipse.prefs 0.2 kB
- src/main/java/.../i18n/LocaleSelector.java 1 kB
- src/main/java/.../i18n/LocaleUtils.java 0.6 kB
- src/main/resources/messages.properties 0.3 kB
- src/main/.../messages_de.properties 0.3 kB
- src/main/.../messages_en.properties 0.3 kB
- src/main/.../META-INF/seam-beans.xml 0.5 kB
- src/main/webapp/css/style.css 0.5 kB
- src/main/webapp/home.xhtml 1 kB
- src/main/webapp/images/flag_de.png 0.4 kB
- src/main/webapp/images/flag_en.png 0.7 kB
- src/main/webapp/index.html 0.1 kB
- src/main/webapp/layout/main.xhtml 0.8 kB
- src/main/webapp/WEB-INF/faces-config.xml 0.4 kB
- src/main/webapp/WEB-INF/web.xml 2 kB
Activity
- All
- Comments
- Work Log
- History
- Activity
- Links Hierarchy
ResourceBundle.getBundle(key.toString()); in Bundles.java returns ResourceBundle with Locale.getDefault(); --> JVM Locale
Added pull request for possible solution
This is certainly a bug that there is no connection between the bundle messages retrieval and the locale of the user. The suggested solution to make the Bundles class Session instead of Application scoped while a good thought, it is not recommended to store large amounts of data within the Session.
The ideal solution is to retain the Application scoped nature of Bundles while also allowing you to retrieve a bundle based on the current users locale
Yep I thought about that too. But its not that easy cause we have a several locales. Each locale can have several resource files for that depending locale. And I think the name should stay as #
{bundles.resourcename.Key}since some applications use that allready. I try later to make a better solution later.
Both projects can be imported in eclipse as maven projects and deployed on jboss6 with "mvn clean package jboss:hard-deploy"