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
Tejas Kanani
How to get language property value inside javascript function ?
29 de Novembro de 2012 00:23
Resposta

Tejas Kanani

Ranking: Liferay Master

Mensagens: 547

Data de entrada: 6 de Janeiro de 2009

Mensagens recentes

Hi,

I want to get language property value inside my javascript function, and after searching in forums found below code for the same.
Liferay.Language.get("key")

When I've used the above code in my Custom Plugins portlet, It just returning me the Key itself instead of the value from my Language_en.properties file. After some more googling found that it only works with portal level language property and not portlet level.

I am using Liferay 6.1.

Is anyone came across such issue and able to find a solution for this problem ?
Any pointer would be appreciated.

Thanks,
Tejas
Oliver Bayer
RE: How to get language property value inside javascript function ?
29 de Novembro de 2012 00:40
Resposta

Oliver Bayer

Ranking: Liferay Master

Mensagens: 751

Data de entrada: 18 de Fevereiro de 2009

Mensagens recentes

Hi Tejas,

you can override or add your language keys into the ext-environment (ext-impl, content). I know it's some sort of a hack but I think it's the quickest solution to get it working emoticon. Otherwise you should check if it's working in the current trunk, look out for maybe already created jira issues or you can try debugging...

Greets Oli
Tejas Kanani
RE: How to get language property value inside javascript function ?
29 de Novembro de 2012 00:56
Resposta

Tejas Kanani

Ranking: Liferay Master

Mensagens: 547

Data de entrada: 6 de Janeiro de 2009

Mensagens recentes

Thanks Oliver for quick reply.

But I would like to avoid making changes in ext for simply displaying the language property for my custom portlet. As in future if i want to add any more property to my portlet, everytime I need to make changes in ext and rebuild it, which I want to avoid.

And I've also checked in JIRA and found one issue raised for the same. But its found closed without any useful solution.
http://issues.liferay.com/browse/LPS-14664

Anybody from Liferay Staff Member has any solution/updates for this issue ?

Thanks,
Tejas
Ali Reza Akbarian
RE: How to get language property value inside javascript function ?
30 de Novembro de 2012 06:48
Resposta

Ali Reza Akbarian

Ranking: New Member

Mensagens: 6

Data de entrada: 7 de Abril de 2012

Mensagens recentes

Hi Tejas

Try This :
LanguageUtil.get(locale, key);

Thanks.