Thanks, this works great. Just as my own version, that I wrote before I saw that there was a reply to the thread :-) well, I guess it's always good to use the thinking cap, or something.
One problem though: When setting the language to "sv" using this component (no country or variant selected) java will choose "messages.properties" before "messages_sv_SE.properties". Changing the filename to "messages_sv.properties" gets the job done, but that's not the way I want it. An other thing: It would be nice if setLocale() updated the country, language, and variant properties when it sets the default locale, so the correct language is selected in the list. | private void setLocale() | { | ... | this.language = locale.getLanguage; | this.country = locale.getCountry(); | this.variant = locale.getVariant | } | Thing number three: I think localeSelector could have a | public void setLocale(java.util.Locale locale) | { | this.locale = locale; | } | This would make it easier to change to a locale when you have an instance of Locale. Thing number four (I hope someone's still reading :-) The ultimate localeSelector would be if the list automagically displayed the supported locales listed in faces-config.xml and used Locale.getDisplayLanguage() for the itemLabel. When doing this I would vote for using locale.getDisplayLanguage(locale) so that the language is displayed in the language of the locale. Someone wanting to change the language of a site should have an easier time locating his preferred language if it is displayed in, you guessed it, his preferred language. View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3929489#3929489 Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3929489 ------------------------------------------------------- This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory! http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 _______________________________________________ JBoss-user mailing list JBoss-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jboss-user