admin 管理员组文章数量: 1086019
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.
版权声明:本文标题:jsp - Liferay portlet language.properties being pulled in but other languages not showing up - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.roclinux.cn/p/1744067911a2527948.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论