Hi Pablo,

You can set default locale with Session.get().setLocale(someLocale).

I added more information in the error message. Now it will print the
used locale and style. Hopefully this way the user will see that
Chrome uses locale1 and Firefox uses locale2.

On Fri, Jul 13, 2012 at 12:21 PM, Pablo Diaz Redondo <[email protected]> wrote:
>
> No, I don't override getLocale, I only have a panel to change the locale when 
> the user likes such as the above code:
>
> public class ChangeLocalePanel extends Panel {
>
>         private static final long serialVersionUID = -627656359411214982L;
>         private static class LocaleDropDown extends DropDownChoice {
>                 private static final long serialVersionUID = 
> 7005942730218677106L;
>
>                 public class LocaleRenderer extends ChoiceRenderer {
>
>                         private static final long serialVersionUID = 
> -6725227495514242466L;
>                         LocaleDropDown localeDropDown;
>                         LocaleRenderer(LocaleDropDown localeDropDown){
>                                 this.localeDropDown = localeDropDown;
>                         }
>                         //@Override
>                         public String getDisplayValue(Object locale) {
>                                 String displayName = "";
>                                 
> if(((Locale)locale).getLanguage().compareToIgnoreCase("es")==0)
>                                         displayName = "locale.spanish";
>                                 else
>                                         displayName = "locale.galician";
>
>                                 return (new StringResourceModel(displayName, 
> localeDropDown, localeDropDown.getInnermostModel())).getString();
>                         }
>                 }
>
>                 LocaleDropDown(String id, @SuppressWarnings("rawtypes") List 
> supportedLocales) {
>                         super(id, supportedLocales);
>                         this.setMarkupId("es");
>                         setChoiceRenderer(new LocaleRenderer(this));
>                         setModel(new IModel() {
>
>                                 private static final long serialVersionUID = 
> 1L;
>
>                                 public Object getObject() {
>                                         return getSession().getLocale();
>                                 }
>
>                                 public void setObject(Object object) {
>                                         getSession().setLocale((Locale) 
> object);
>                                 }
>
>                                 public void detach() {
>                                 }
>                         });
>                 }
>
>                 @Override
>                 protected boolean wantOnSelectionChangedNotifications() {
>                         return true;
>                 }
>         }
>         public ChangeLocalePanel(String id, @SuppressWarnings("rawtypes") 
> List supportedLocales){
>                 super(id);
>                 add(new LocaleDropDown("localeSelect",supportedLocales));
>
>         }
> }
>
>
> El 13/07/2012, a las 10:59, Decebal Suiu escribió:
>
>> In your Session override getLocale() ?
>>
>> --
>> View this message in context: 
>> http://apache-wicket.1842946.n4.nabble.com/Missingresourceexception-only-in-Firefox-but-not-in-Chrome-or-Safari-tp4650503p4650508.html
>> Sent from the Users forum mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [email protected]
>> For additional commands, e-mail: [email protected]
>>
>



-- 
Martin Grigorov
jWeekend
Training, Consulting, Development
http://jWeekend.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to