留言板

i18n not working for other than en_us language

Ameenulla Hussainy,修改在7 年前。

i18n not working for other than en_us language

New Member 帖子: 20 加入日期: 12-7-24 最近的帖子
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,修改在7 年前。

RE: i18n not working for other than en_us language

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
Are you using <liferay-ui:message /> tags in your JSPs?
Ameenulla Hussainy,修改在7 年前。

RE: i18n not working for other than en_us language

New Member 帖子: 20 加入日期: 12-7-24 最近的帖子
yes i am using <liferay-ui:message />
<liferay-ui:message key="user_name_label" />
thumbnail
David H Nebinger,修改在7 年前。

RE: i18n not working for other than en_us language

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

RE: i18n not working for other than en_us language

New Member 帖子: 20 加入日期: 12-7-24 最近的帖子
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,修改在7 年前。

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

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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,修改在7 年前。

RE: i18n not working for other than en_us language

New Member 帖子: 20 加入日期: 12-7-24 最近的帖子
Hello david thanks for reply,
your guess was correct user profile page was set to use English, after changing it is showing appropriate language.