Fóruns

Início » Liferay Portal » English » 3. Development

Visualização combinada Visão plana Exibição em árvore
Tópicos [ Anterior | Próximo ]
toggle
Nishikant sapkal
using liferay locale
29 de Setembro de 2010 03:58
Resposta

Nishikant sapkal

Ranking: Junior Member

Mensagens: 76

Data de entrada: 15 de Fevereiro de 2010

Mensagens recentes

I just wanted to know does liferay by default, checks the locale and will display content in particular language depends on locale(if i am using liferay as multilingual cms using web content display in liferay 5.2.3) or will have to do some customization?
Felix Ashirov
RE: using liferay locale
29 de Setembro de 2010 04:49
Resposta

Felix Ashirov

Ranking: Regular Member

Mensagens: 128

Data de entrada: 26 de Fevereiro de 2010

Mensagens recentes

At first Liferay determines users's locale. For unauthentificated users it should be default locale(it can be changed in "Control panel" > "Settings" > "Display settings")/

You can set locale.default.request=true in portal properties. In this case Liferay will determine unauthenticated users' preferred language using the Accept-Language HTTP-header.

Then Liferay checks is there localized content for user's language and displays one, otherwise Liferay displays content for default locale's language.
Nishikant sapkal
RE: using liferay locale
30 de Setembro de 2010 05:30
Resposta

Nishikant sapkal

Ranking: Junior Member

Mensagens: 76

Data de entrada: 15 de Fevereiro de 2010

Mensagens recentes

Thanks Felix for your reply,
I tried it but when i am trying to change the default locale its not getting changed its still showing me every thing in my default locale that is English (us)(also not showing any error in log file). What i am trying to achieve is that for testing purpose i am changing my locale to Chinese by or any thing else ("liferay" >"control panel">"display setting") so that everything i will see in Chinese and since my system locale is default English (us)after setting the property locale.default.request=true
in portal_ext.properties and deploying and restart the server i should be able to see everything in English(us)for both authenticate as well as unauthenticated user isn't it? but i got stuck up. Is this the proper way that i am following or is there any other way to to verify this locale test. please let me know.
Felix Ashirov
RE: using liferay locale
30 de Setembro de 2010 07:01
Resposta

Felix Ashirov

Ranking: Regular Member

Mensagens: 128

Data de entrada: 26 de Fevereiro de 2010

Mensagens recentes

Have you cleared cookies in your Browser after changing Liferay configuration?
Liferay sets in your browser a Cookie "GUEST_LANGUAGE_ID" at 1st visit and then uses it as an preferred language for your browser. So for testing purpose clear cookie every time you change Liferay's configuration.

I'm a little confused how do you want Liferay to behave with users' locale
There are two possible behaviors
  • If you want Liferay to use default locale (which is specified in Control Panel > Settings) for all unauthentificated and newly registered users, then set locale.default.request=false in portal-ext.properties.
  • Otherwise set locale.default.request=true

In both cases default locale for registered users (which is specified in User's account > Display Settings) will not be changed

So testing locale settings should consist of 4 steps:
  1. Change Liferay Configuration and restart it
  2. Clear your Browser cookies
  3. Go to liferay homepage and see if content displays in proper locale
  4. Sign up as new user and check his locale. Is it what you need?


Good luck