Search code examples
internationalizationliferay

In Liferay 7.x, how can we have in a single module more portlets and for each of them a different Language.properties?


I created a mvc-portlet module in Liferay 7.x, that has 2 portlets, test and test2. Each portlet has its own Language.porperties. Each property is its subfolder

resources/content/test/Language.properties 

and

resources/content/test2/Language.properties. 

In the portlet compoent properties I have

"javax.portlet.resource-bundle=content.test.Language" 

and

"javax.portlet.resource-bundle=content.test2.Language" 

but the default values (for the mvc-portlet template) for the keys won’t load. What am I doing wrong here?

You can find some sample code here: https://github.com/charalamposc/liferay-literals


Solution

  • So, I found a solution (don’t know if it's the best - but it works). I implemented two resource bundle loaders (https://help.liferay.com/hc/en-us/articles/360029317371-Resource-Bundle-Override), one for every resource. It seems, it adds an additional resource bundle to the module components.