Liferay - How to i18n model-resources?

241 views Asked by At

How can I translate my custom model-resources? Given the following default.xml:

<model-resource>
    <model-name>de.foo.db.model.FooBar</model-name>
    <portlet-ref>
        <portlet-name>myportlet</portlet-name>
    </portlet-ref>
    <permissions>
        <supports>
            <action-key>DECLINE_OWNER</action-key>
            <action-key>DECLINE_DEPARTMENT</action-key>
        </supports>
        <site-member-defaults/>
        <guest-defaults/>
        <guest-unsupported>
            <action-key>DECLINE_OWNER</action-key>
            <action-key>DECLINE_DEPARTMENT</action-key>
        </guest-unsupported>
        <owner-defaults/>
    </permissions>
</model-resource>

When I want to define these permissions for a role Control-panel-> roles-> myRole-> define permissions they get listed as:

  • model.resource.de.foo.db.model.FooBar:action.DECLINE_OWNER
  • model.resource.de.foo.db.model.FooBar:action.DECLINE_DEPARTMENT

But I'd like them to show up as:

  • FooBar: Decline own element
  • FooBar: Decline element for own department

I'm running Liferay 6.2 EE.

1

There are 1 answers

2
Pankaj Kathiriya On

You can add below language properties for all actions in Language properties file.

action.DECLINE_OWNER=FooBar: Decline own element
action.DECLINE_DEPARTMENT= FooBar: Decline element for own department