问题
I've followed the instructions from this tutorial to introduce a new portlet level permission for my custom portlet.
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
On the Define permissions
tab, it still shows the label key, not the value:
What's missing?
回答1:
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:
Create a
liferay-hook.xml
in yourdocroot/WEB-INF
directory:<?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>
Create
docroot/WEB-INF/src/content-portal/Language.properties
:action.PARTNER_ADMIN_CONTRACTING=Admin contracting
This should work!
来源:https://stackoverflow.com/questions/28107289/liferay-custom-portlet-permission-label-missing