Foren

i18n not working for other than en_us language

Ameenulla Hussainy, geändert vor 7 Jahren.

i18n not working for other than en_us language

New Member Beiträge: 20 Beitrittsdatum: 24.07.12 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: i18n not working for other than en_us language

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Are you using <liferay-ui:message /> tags in your JSPs?
Ameenulla Hussainy, geändert vor 7 Jahren.

RE: i18n not working for other than en_us language

New Member Beiträge: 20 Beitrittsdatum: 24.07.12 Neueste Beiträge
yes i am using <liferay-ui:message />
<liferay-ui:message key="user_name_label" />
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: i18n not working for other than en_us language

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: i18n not working for other than en_us language

New Member Beiträge: 20 Beitrittsdatum: 24.07.12 Neueste Beiträge
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, geändert vor 7 Jahren.

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

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
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, geändert vor 7 Jahren.

RE: i18n not working for other than en_us language

New Member Beiträge: 20 Beitrittsdatum: 24.07.12 Neueste Beiträge
Hello david thanks for reply,
your guess was correct user profile page was set to use English, after changing it is showing appropriate language.