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

问题描述

在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

你可能感兴趣的:([Java][Liferay] 如何从Javascript的function中获取language property的值)