Foren

Hook for Post Login Locale

thumbnail
Fakhruddin S Mushki, geändert vor 9 Jahren.

Hook for Post Login Locale

Junior Member Beiträge: 78 Beitrittsdatum: 10.04.13 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Hook for Post Login Locale

Regular Member Beiträge: 205 Beitrittsdatum: 05.01.11 Neueste Beiträge
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, geändert vor 9 Jahren.

RE: Hook for Post Login Locale (Antwort)

Liferay Master Beiträge: 654 Beitrittsdatum: 06.01.09 Neueste Beiträge
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