0

I'm trying to make my jsf application support resources from multiple locales.

I've already created the contents on the resources folder and that works fine when I have the following on my faces.config:

<supported-locale>en</supported-locale>

<supported-locale>fr</supported-locale>

However, I'd like to support US English, Canadian English and UK English, for instance.

How do I go about doing that?

<supported-locale>en_CA</supported-locale>
<supported-locale>en_US</supported-locale>

The above doesn't seem to work. Any suggestions are highly appreciated! Thanks.

fabiorocha
  • 140
  • 1
  • 14
  • possible duplicate of [How to internationalize a java web application](http://stackoverflow.com/questions/4276061/how-to-internationalize-a-java-web-application) – Paul Vargas Oct 22 '13 at 21:48
  • @PaulVargas This question is about JSF, so no duplicate – noone Oct 23 '13 at 05:50

2 Answers2

2

The supported locales actually work as described above:

<supported-locale>en_CA</supported-locale>
<supported-locale>en_US</supported-locale>

My problem was that en_CA and en_US should not be inside the "en" folder in the resources folder. They should be subfolders of resources.

.resources
..en
..en_CA
..en_US

Rather ugly but I guess that's how JSF wants it. Nested folders would be more elegant in my opinion.

fabiorocha
  • 140
  • 1
  • 14
0

have you read the oracle documentation? It's Chapter 17 about Internationalization and Localizing Web Applications from here. just read and follow the documentation and I'm sure it will work.

blitzen12
  • 1,350
  • 3
  • 24
  • 33