留言板

Hook for Post Login Locale

thumbnail
Fakhruddin S Mushki,修改在9 年前。

Hook for Post Login Locale

Junior Member 帖子: 78 加入日期: 13-4-10 最近的帖子
Dears,

I am using Liferay 6.2 bundled with JBoss 7.

Below is my issue:
There are three locales configured in my site. English, Arabic and Kurdish. When I log in to my portal then post login, the portal opens up in user default language and doesn't remain on the language where it was before login.

Eg. If Portal opens up in English and when I log in using user whose default display language is Arabic then post login in , the site goes to Arabic. Where else I dont want this feature. I want it to be on the same language where it was before i.e English.

Please let me know if it is not clear.

I need to a hook for it. please guide.
thumbnail
Sandip Patel,修改在9 年前。

RE: Hook for Post Login Locale

Regular Member 帖子: 205 加入日期: 11-1-5 最近的帖子
Yuo are saying " then post login in , the site goes to Arabic".
So Have you use any redirection after login ?
are you displaying information based on user's default data languange ?
thumbnail
Tejas Kanani,修改在9 年前。

RE: Hook for Post Login Locale (答复)

Liferay Master 帖子: 654 加入日期: 09-1-6 最近的帖子
Hi,

Some time ago, I've wrote one hook(Browser Language Hook) for Liferay 6.1 which does the same thing. That hook will pick the locale from browser and set the same for logged in user. So upon user login it will get the locale currently selected for browser and set the same as logged in user's locale. So here it's totally depends upon the language selected in browser.

I'm not quite sure about if in 6.2, we have any other option available OOTB. If not, probably you can also write the similar hook for 6.2.

Also check below property available in portal.properties of LR 6.2 if it's somewhat helpful.

Set this to true if unauthenticated users get their preferred language from the Accept-Language header. Set this to false if unauthenticated users get their preferred language from their company.

Defaults:
locale.default.request=false


HTH !

- Tejas