Foros de discusión

i18n not working for other than en_us language

Ameenulla Hussainy, modificado hace 7 años.

i18n not working for other than en_us language

New Member Mensajes: 20 Fecha de incorporación: 24/07/12 Mensajes recientes
Hi,

This is Ameenulla.
I want to show my application in polish language, when is set language to en_us it worked but when is set polish it is not working, i have done following things it is not loading from specified langage.properties, do i need to add any other properties

Step 1 : i have added following tags in portlet.xml

<supported-locale>pl_POL</supported-locale>
<resource-bundle>content/language</resource-bundle>


i tried <supported-locale>pl_PL</supported-locale>
and
<supported-locale>pl</supported-locale> also


Step 2: created a property file with name
language_pl_POL.properties
and deployed
Step 3 : Changed language in browser to polish and restarted
thumbnail
David H Nebinger, modificado hace 7 años.

RE: i18n not working for other than en_us language

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Are you using <liferay-ui:message /> tags in your JSPs?
Ameenulla Hussainy, modificado hace 7 años.

RE: i18n not working for other than en_us language

New Member Mensajes: 20 Fecha de incorporación: 24/07/12 Mensajes recientes
yes i am using <liferay-ui:message />
<liferay-ui:message key="user_name_label" />
thumbnail
David H Nebinger, modificado hace 7 años.

RE: i18n not working for other than en_us language

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Well then is it the rules of resolution?

When translating a key, it will look for an exact locale match for an RB and use the mapping value there; if it doesn't find one it falls back to the to less specific locale RBs looking for a key value and, if not found in any of those, will look in language.properties for the final version. The last step, if it is not found in any of those, it will just return the key itself for the translation.
Ameenulla Hussainy, modificado hace 7 años.

RE: i18n not working for other than en_us language

New Member Mensajes: 20 Fecha de incorporación: 24/07/12 Mensajes recientes
Hello David H Nebinger thanks for your reply,
after debugging i found that
themeDisplay.getLocale()
request.getLocale()
is returning en_US even after changing language in browser to polish.
thumbnail
David H Nebinger, modificado hace 7 años.

RE: i18n not working for other than en_us language (Respuesta)

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
I'm guessing your user profile page is set to use English, if you change it there you will likely see the right language.
Ameenulla Hussainy, modificado hace 7 años.

RE: i18n not working for other than en_us language

New Member Mensajes: 20 Fecha de incorporación: 24/07/12 Mensajes recientes
Hello david thanks for reply,
your guess was correct user profile page was set to use English, after changing it is showing appropriate language.