在 Liferay 7.x 中,我们如何在单个模块中拥有更多的 portlet,并且每个 portlet 都有不同的 Language.properties?

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

我在 Liferay 7.x 中创建了一个 mvc-portlet 模块,它有 2 个 portlet,test 和 test2。每个 portlet 都有自己的 Language.porperties。每个属性是它的子文件夹

resources/content/test/Language.properties 

resources/content/test2/Language.properties. 

在我拥有的 portlet 组件属性中

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

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

但键的默认值(mvc-portlet 模板)不会加载。我在这里做错了什么?

您可以在此处找到一些示例代码:https://github.com/charalamposc/liferay-literals

所以,我找到了一个解决方案(不知道它是否是最好的 - 但它有效)。我实现了两个资源包加载器 (https://help.liferay.com/hc/en-us/articles/360029317371-Resource-Bundle-Override),每个资源一个。看起来,它为模块组件添加了一个额外的资源包。