Fork me on GitHub

[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

posted @ 2016-12-13 20:31  种花生的读书人  阅读(223)  评论(0编辑  收藏  举报

该博客仅作为记录笔记,转载随意