Sunday, March 23, 2014

How to support multiple languages for Portlet category in Liferay

As a CMS, Liferay allows us to deploy our custom portlet, and also define category for the custom portlet.

We can actually define category for all my custom portlets. eg, My Category Name.
Besides, we also can make the custom category name to support multi-languages with resource bundle.

Steps:

1. In liferay-display.xml, and navigate to the target category section.
<category name="My Category Name">
    <portlet id="myPortlet1" />
    <portlet id="myPortlet2" />
</category>

2. create the bundle key in Language_en_US.properties
my.category.name=My Category Name

3. replace the name attribute with bundle key in <category /> tag as below.
<category name="my.category.name">
    <portlet id="myPortlet1" />
    <portlet id="myPortlet2" />
</category>


Done!!

LinkWithin

Related Posts Plugin for WordPress, Blogger...