掲示板

If JSF Portlet is in subcategory, root category is not translated

7年前 に Marcus Hiebenga によって更新されました。

If JSF Portlet is in subcategory, root category is not translated

New Member 投稿: 20 参加年月日: 17/01/11 最新の投稿
Hello,
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

添付ファイル:

thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: If JSF Portlet is in subcategory, root category is not translated

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
Hi Marcus.

Sorry for the delay. We are checking this now and give you some answer hopefully this week.
thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: If JSF Portlet is in subcategory, root category is not translated

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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.
thumbnail
7年前 に Juan Gonzalez によって更新されました。

RE: If JSF Portlet is in subcategory, root category is not translated

Liferay Legend 投稿: 3089 参加年月日: 08/10/28 最新の投稿
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.