krstf
krstf

Reputation: 627

Liferay custom portlet permission label missing

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:

custom portlet permission label is missing

What's missing?

Upvotes: 1

Views: 500

Answers (1)

Andrea Di Giorgi
Andrea Di Giorgi

Reputation: 967

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:

  1. Create a liferay-hook.xml in your docroot/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>
    
  2. Create docroot/WEB-INF/src/content-portal/Language.properties:

    action.PARTNER_ADMIN_CONTRACTING=Admin contracting   
    

This should work!

Upvotes: 4

Related Questions