Forums de discussion

Hook for Post Login Locale

thumbnail
Fakhruddin S Mushki, modifié il y a 9 années.

Hook for Post Login Locale

Junior Member Publications: 78 Date d'inscription: 10/04/13 Publications récentes
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, modifié il y a 9 années.

RE: Hook for Post Login Locale

Regular Member Publications: 205 Date d'inscription: 05/01/11 Publications récentes
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, modifié il y a 9 années.

RE: Hook for Post Login Locale (Réponse)

Liferay Master Publications: 654 Date d'inscription: 06/01/09 Publications récentes
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