掲示板

i18n not working for other than en_us language

7年前 に Ameenulla Hussainy によって更新されました。

i18n not working for other than en_us language

New Member 投稿: 20 参加年月日: 12/07/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
7年前 に David H Nebinger によって更新されました。

RE: i18n not working for other than en_us language

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
Are you using <liferay-ui:message /> tags in your JSPs?
7年前 に Ameenulla Hussainy によって更新されました。

RE: i18n not working for other than en_us language

New Member 投稿: 20 参加年月日: 12/07/24 最新の投稿
yes i am using <liferay-ui:message />
<liferay-ui:message key="user_name_label" />
thumbnail
7年前 に David H Nebinger によって更新されました。

RE: i18n not working for other than en_us language

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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.
7年前 に Ameenulla Hussainy によって更新されました。

RE: i18n not working for other than en_us language

New Member 投稿: 20 参加年月日: 12/07/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
7年前 に David H Nebinger によって更新されました。

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

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
I'm guessing your user profile page is set to use English, if you change it there you will likely see the right language.
7年前 に Ameenulla Hussainy によって更新されました。

RE: i18n not working for other than en_us language

New Member 投稿: 20 参加年月日: 12/07/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.