Fórum

Liferay 6.2 languages switching

thumbnail
Yannis Konstas, modificado 9 Anos atrás.

Liferay 6.2 languages switching

Junior Member Postagens: 40 Data de Entrada: 27/06/14 Postagens Recentes
Hi,

In my portal all authenticated users have as default language English. In pages' theme there is a language selector using $taglibLiferay.language("fm", null, "languageId", 3) which gets all languages that I have selected inside portal-ext.properties(locales=en_GB,fr_FR,de_DE). All these languages are displayed normally in selector, but when a logged-in user tries to switch a language in selector, the selected option remains always the user's language. e.g. A user with English language cannot switch to French. Although, the language changes in selector, the page is reloaded in English with selector's option turned to English.

Does anyone has a workaround on this?

Note: The mappings in web.xml are correct.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Liferay 6.2 languages switching

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Hey Yannis,

I was messing around with languages a few weeks back and noticed that the language for a logged in user is always pulled from their "User account". When you toggle the language using that drop down (and you are logged in) does the preferred language for the users profile change?
thumbnail
Yannis Konstas, modificado 9 Anos atrás.

RE: Liferay 6.2 languages switching

Junior Member Postagens: 40 Data de Entrada: 27/06/14 Postagens Recentes
Hey Andew,
No the preferred language for the users does not change when I change the selector's value, instead when I tried to change language from user's account, the selector's value has changed automatically.
A guy on the net suggested me to try this $taglibLiferay.language("fm", null, "_82_languageId", 3) instead of $taglibLiferay.language("fm", null, "languageId", 3) and now the languages switching is functional i.e. when selector's language changes, the active language of the portal changes also, independently of user's preferred language.
thumbnail
Andew Jardine, modificado 9 Anos atrás.

RE: Liferay 6.2 languages switching

Liferay Legend Postagens: 2416 Data de Entrada: 22/12/10 Postagens Recentes
Interesting -- with the old approach that you were using, did it work when you were the "default" user? (ie. not signed in)
thumbnail
Yannis Konstas, modificado 9 Anos atrás.

RE: Liferay 6.2 languages switching

Junior Member Postagens: 40 Data de Entrada: 27/06/14 Postagens Recentes
No, it didn't, I had also to change user's preferred language.