[Java][Liferay] 如何從Javascript的function中獲取language property的值

問題描述

在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

相關文章
相關標籤/搜索