Liferay - 如何i18n模型资源?

时间:2014-11-19 12:47:41

标签: internationalization liferay liferay-6 roles role

如何翻译自定义模型资源? 鉴于以下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>

当我想为角色Control-panel-> roles-> myRole-> define permissions定义这些权限时 它们被列为:

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

但我希望他们出现在:

  • FooBar:拒绝自己的元素
  • FooBar:自己部门的拒绝元素

我正在运行Liferay 6.2 EE。

1 个答案:

答案 0 :(得分:0)

您可以在语言属性文件中为所有操作添加以下语言属性。

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