Liferay自定义Portlet权限标签丢失 [英] Liferay custom portlet permission label missing
问题描述
我已经按照中的说明进行操作本教程为我的自定义portlet引入了新的portlet级别权限.
I've followed the instructions from this tutorial to introduce a new portlet level permission for my custom portlet.
在资源操作映射XML中,有一个名为PARTNER_ADMIN_CONTRACTING
的新操作键,我已经在Language.properties
文件中添加了以下行:
In the resource-action-mapping XML there is a new action-key called PARTNER_ADMIN_CONTRACTING
, and I've added the following line to the Language.properties
file:
action.PARTNER_ADMIN_CONTRACTING=Admin contracting
在Define permissions
选项卡上,它仍显示标签键,而不是值:
On the Define permissions
tab, it still shows the label key, not the value:
缺少什么?
推荐答案
您必须将action.PARTNER_ADMIN_CONTRACTING=Admin contracting
语言键添加到门户网站资源包中,因为控制面板不会在您的portlet中查找翻译.您可以使用语言钩功能可以做到这一点:
You have to add the action.PARTNER_ADMIN_CONTRACTING=Admin contracting
language key to the portal resource bundle, because the Control Panel does not look for the translation in your portlet. You can use the language hook feature do to this:
-
在您的
docroot/WEB-INF
目录中创建一个liferay-hook.xml
:
<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.2.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_2_0.dtd">
<hook>
<language-properties>content-portal/Language.properties</language-properties>
</hook>
创建docroot/WEB-INF/src/content-portal/Language.properties
:
action.PARTNER_ADMIN_CONTRACTING=Admin contracting
这应该有效!
这篇关于Liferay自定义Portlet权限标签丢失的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!