Problems with locale,please help me...



Hi guys,
i'm trying to solve this problem but nothing!!!!
I've a jsf application with 2 languages,italian(default )and english.
I have an italian resource bundle and an english one.
When i run the application and i select in a page english versione,all
the pages became in english,but application message like validator msg
etc....are still in italian!!
In my bean i've
Locale
locale=getFacesContext().getExternalContext().getRequestLocale();
System.out.println(locale);
ResourceBundle rb =
ResourceBundle.getBundle("microarray.bundle.messageResource", locale);
String result = rb.getString("groupPresent");
System.out.println(result);[/code

when i'm in english mode and i click on a submit botton i see
it
the message in italian,

because the locale it retrieves is ITALIAN, so the message is in
italian.
But i'm in english mode!!!!!!!
This is my faces config.xml
[code]<application>
<message-bundle>microarray.bundle.messageResource</message-bundle>
<locale-config>
<default-locale>it</default-locale>
<supported-locale>it</supported-locale>
<supported-locale>en</supported-locale>
</locale-config>
</application>



and this is my method to populate dropdown list of locales...please
help me...


public List getSupportedtLocaleItems()
{
if (localeItems == null)
{
localeItems = new ArrayList();
Application app =
FacesContext.getCurrentInstance().getApplication();
for (Iterator i = app.getSupportedLocales(); i.hasNext(); )
{
Locale locale = (Locale)i.next();
SelectItem item = new SelectItem(locale.toString(),
locale.getDisplayName());
localeItems.add(item);
}
if (localeItems.size() == 0)
{
Locale defaultLocale = app.getDefaultLocale();
localeItems.add(new SelectItem(defaultLocale.toString(),
defaultLocale.getDisplayName()));
}
}
return localeItems;
}
public String getLocale()
{
return
FacesContext.getCurrentInstance().getViewRoot().getLocale().toString();
}

public void setLocale(String locale)
{
FacesContext.getCurrentInstance().getViewRoot().setLocale(new
Locale(locale));
}

.



Relevant Pages

  • We need Language Exchange Partners, we can teach you Italian
    ... We can teach you Italian in exchange. ... I'm looking to someone to improve my english by talking on skype. ... I want to learn: French, ... Conttatami, per un language exchange. ...
    (soc.culture.italian)
  • We need Language Exchange Partners, we can teach you Italian
    ... We need Language Exchange Partners, we can teach you Italian ... I want to learn: English ... I want to learn: Spanish ...
    (soc.culture.italian)
  • Re: Oona King say Madonna was right to adopt baby
    ... have refused to 'adopt' me into their culture are labelled 'racists'? ... My mother is English, my father is Italian with maybe a bit of Algerian ... English people think I'm foreign (a fact which it took me ...
    (uk.politics.misc)
  • vaguely sailing related joke...
    ... On a group of beautiful deserted islands in the middle of nowhere, ... Italian men and 1 Italian woman ... English men and 1 English woman ... The two Chinese men have set up a pharmacy, a liquor store, a ...
    (uk.rec.sailing)
  • Re: World Shocked That Wolfowitz Has Girlfriend
    ... news about Mr. Wolfowitz ranged from "Who would date Wolfowitz?" ... Two Italian men and one Italian woman ... Two English men and one English woman ... on these absolutely stunning deserted islands in the ...
    (soc.culture.romanian)