您的位置:首页 > Web前端 > JavaScript

[Java][Liferay] 如何从Javascript的function中获取language property的值

2016-12-13 20:31 232 查看

问题描述

在Portlet中,Javascript中通过
Liferay.Language.get("key")
的方式是拿不到自己添加的property的值,原因是Liferay.Language是从portal的language property中去找的,对于portlet的property是不理睬的,所以解决方案是通过hook去添加property,这里你不用担心portal property会造成性能的问题:

Liferay provides a way to get the value of different language keys. This allows you to keep Liferay's internationalization in Javascript. These results are also cached by the user, so multiple requests to the same key will not degrade performance

参照: Liferay JavaScript API
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: