最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

jsp - Liferay portlet language.properties being pulled in but other languages not showing up - Stack Overflow

programmeradmin3浏览0评论

I am working on trying to add translations to a liferay portlet. The translations are going in jsp pages. I have been following the liferay instructions but no matter what I do I can't get it to pick up the other language files. It correctly pulls in the keys and uses the values that I have in the default Language.properties file. But I cannot get it to display the values in Language_es.properties or Language_en.properties.

In the jsp pages I have <%@ taglib uri="; prefix="liferay-ui" %> at the top. Then for things to be translated I have <liferay-ui:message key="message-key" />.

The translation files are in resources/content/Language.properties (and Language_en.properties, and Language_es.properties). I believe this is the right location because it correctly uses the keys and puts the value in from my Language.properties file.

I have added Spanish to the available locales/languages in liferay admin. So now there is the /es/ or /en/ versions of pages. I believe it is getting the right locale because it seems to pull in some default translations. I had register and or as words in the property files but since it wasn't finding them it was translating to registrar and o. I had also changed chrome to spanish as the default language/locale which was working. But no matter what it just pulls in the default properties file.

I am thinking maybe there is an issue with bundling.

I tried adding <resource-bundle>content.Language</resource-bundle> to the liferay-portlet.xml and the portlet.xml and that did not seem to work. It would say resource-bundle must be defined. But after looking at liferays liferay-portlet-app documentation that is not in the properties available. Also the liferay instructions don't seem to mention that as a step. It seems like it should be as simple as having those property files and pulling in the keys.

Does anyone have any idea what might be necessary to pull in the language property files? This is on liferay dxp 7.2.

发布评论

评论列表(0)

  1. 暂无评论