在Portlet中,Javascript中经过Liferay.Language.get("key")
的方式是拿不到本身添加的property的值,缘由是Liferay.Language是从portal的language property中去找的,对于portlet的property是不理睬的,因此解决方案是经过hook去添加property,这里你不用担忧portal property会形成性能的问题:web
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 APIide