Foren
If JSF Portlet is in subcategory, root category is not translated
Marcus Hiebenga, geändert vor 7 Jahren.
If JSF Portlet is in subcategory, root category is not translated
New Member Beiträge: 20 Beitrittsdatum: 11.01.17 Neueste Beiträge
Hello,
What I have done:
I created a new Liferay Faces Alloy project with the maven generator liferayfaces.org:
Then I changed the liferay-display.xml to look like this to have subcategories:
I added the resource bundle to the portlet.xml because liferay needs to know where to look for translations:
Then I added the language keys to the i18n.properties file:
When I deploy the portlet to liferay my root category my.category.root is not translated. See screenshot below. Why?
Thanks for your help.
Marcus
What I have done:
I created a new Liferay Faces Alloy project with the maven generator liferayfaces.org:
mvn archetype:generate \
-DarchetypeGroupId=com.liferay.faces.archetype \
-DarchetypeArtifactId=com.liferay.faces.archetype.alloy.portlet \
-DarchetypeVersion=5.0.1 \
-DgroupId=com.mycompany \
-DartifactId=com.mycompany.my.alloy.portlet
Then I changed the liferay-display.xml to look like this to have subcategories:
<!--?xml version="1.0"?-->
<display>
<category name="my.category.root">
<category name="my.category.level1">
<portlet id="com.mycompany.my.alloy.portlet" />
</category>
</category>
</display>
I added the resource bundle to the portlet.xml because liferay needs to know where to look for translations:
<!--?xml version="1.0"?-->
<portlet-app xmlns="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemalocation="http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd http://java.sun.com/xml/ns/portlet/portlet-app_2_0.xsd" version="2.0">
<portlet>
<portlet-name>com.mycompany.my.alloy.portlet</portlet-name>
<display-name>com.mycompany.my.alloy.portlet</display-name>
<portlet-class>javax.portlet.faces.GenericFacesPortlet</portlet-class>
<init-param>
<name>javax.portlet.faces.defaultViewId.view</name>
<value>/WEB-INF/views/view.xhtml</value>
</init-param>
<expiration-cache>0</expiration-cache>
<supports>
<mime-type>text/html</mime-type>
</supports>
<resource-bundle>i18n</resource-bundle>
<portlet-info>
<title>com.mycompany.my.alloy.portlet</title>
<short-title>com.mycompany.my.alloy.portlet</short-title>
<keywords>com.mycompany.my.alloy.portlet</keywords>
</portlet-info>
<security-role-ref>
<role-name>administrator</role-name>
</security-role-ref>
<security-role-ref>
<role-name>guest</role-name>
</security-role-ref>
<security-role-ref>
<role-name>power-user</role-name>
</security-role-ref>
<security-role-ref>
<role-name>user</role-name>
</security-role-ref>
</portlet>
</portlet-app>
Then I added the language keys to the i18n.properties file:
# These messages can be accessed via EL using the implicit i18n object provided by Liferay Faces Util. When the portlet
# is deployed to any portal, the i18n object can also access messages found in a portlet.xml <resource-bundle> . When
# deployed to Liferay Portal, the i18n object can also access messages found in the portal's Language.properties file.
com.mycompany.my.alloy.portlet-hello-world=Hello com.mycompany.my.alloy.portlet!
my.category.root=Root Category
my.category.level1=Level 1 Category
</resource-bundle>
When I deploy the portlet to liferay my root category my.category.root is not translated. See screenshot below. Why?
Thanks for your help.
Marcus
Anhänge:
Juan Gonzalez, geändert vor 7 Jahren.
RE: If JSF Portlet is in subcategory, root category is not translated
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Marcus.
Sorry for the delay. We are checking this now and give you some answer hopefully this week.
Sorry for the delay. We are checking this now and give you some answer hopefully this week.
Juan Gonzalez, geändert vor 7 Jahren.
RE: If JSF Portlet is in subcategory, root category is not translated
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi again Marcus.
Seems this problem can be reproduced with a non-JSF portlet in Liferay 7, even in master branch. We will investigate the issue and post here the LPS ticket opened for it.
Seems this problem can be reproduced with a non-JSF portlet in Liferay 7, even in master branch. We will investigate the issue and post here the LPS ticket opened for it.
Juan Gonzalez, geändert vor 7 Jahren.
RE: If JSF Portlet is in subcategory, root category is not translated
Liferay Legend Beiträge: 3089 Beitrittsdatum: 28.10.08 Neueste Beiträge
Hi Marcus.
I already have the fix for this issue. Will send it to review soon. Please watch https://issues.liferay.com/browse/LPS-70417 if you want to receive notifications about its status.
I already have the fix for this issue. Will send it to review soon. Please watch https://issues.liferay.com/browse/LPS-70417 if you want to receive notifications about its status.