Internationalization is one of the most easiest things to do in Liferay Portlet Plugin. Following are the steps to configure & pick-up properties resource bundle:
- In portlet.xml file make an entry under after <supports> as follows: <resource-bundle>content/Language-ext</resource-bundle>
- Create a folder under src called content and within content create a file called Language-ext.properties file. Configure the required properties in this file. Create properties file for other languages for e.g Langauage-ext_es.properties for Spanish.
- Configure a property called javax.portlet.title in each one of the Language-ext files with values based on the language that the property file stands for.
- Build your portlet and deploy it. Drop your portlet on the page. Also drop Language portlet.
- Change from one langauge to the other (change to Esapan) and you will get title that you have configured in Langauage-ext_es.properties file and then change to English. You will get the title that you configured in Langauage-ext.properties
No comments:
Post a Comment