Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hitoshi Ozawa
Translation of Portlet Titles
March 27, 2011 5:09 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I think everybody is aware that some portlet titles are not being translated. To be more accurate, portlet titles not defined in Liferay's Language_xx.properties files are not being picked up. There are some comments that defining it in portlet's WEB-INF\classes\content\Language_xx.properties should translated the titles, but I haven't seen a portlet that actually have title translation with this method.

It seems JSR portlet specification doesn't cover this area.

It seems there are 2 alternatives:
1. Put all portlet titles in Liferay's Language_xx.properties - this is OK for Liferay supported portlets, but kind of difficult for community portlets.
2. Have a standardized tested methodology or sample coding template so we'll have a consistent way of getting portlet titles translated.

BTW, there is a bug in encoding. XML encoding in portlet.xml is actually not being used - seems like it always load the xml file in latin1 regardless of the xml encoding specified.
Julio Camarero
RE: Translation of Portlet Titles
March 28, 2011 1:35 AM
Answer

Julio Camarero

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1663

Join Date: July 15, 2008

Recent Posts

Hi Hitoshi,

you should be able to localize the portlets using the language.properties files. This is covered by the JSR spec.

You can have a look at the Knowledge Base plugin which is in the plugins repository. The number 1 is the portletId (defined in portlet.xml) and the knowledgebaseportlet is the name of the plugin.

1javax.portlet.description.1_WAR_knowledgebaseportlet=Knowledge Base provides a means for collecting, organizing, and retrieving of content pertaining to product documentation and support. Administrators can provide users with access to templates to facilitate the creation of knowledge base articles.
2javax.portlet.title.1_WAR_knowledgebaseportlet=Knowledge Base


We follow the same pattern in the core:

1javax.portlet.title.11=Directory


cheers!
Hitoshi Ozawa
RE: Translation of Portlet Titles
March 28, 2011 3:48 AM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Yes, I've looked at the knowledge base portlet. The messages within the portlet are all being translated correctly, but unfortunately, the title is not appearing translated.

I've gone through official Liferay portlets and other community portlets and it seems the only portlet that have title translated in the ones with title defined in Liferay's core Language_xx.properties file.

I, also, changed to Language other than Japanese, and the title were still all in English. Have anyone else really tested this?
Hitoshi Ozawa
RE: Translation of Portlet Titles
March 28, 2011 4:00 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

I'm attaching a screen shot to show that it's not being translated.

My Language_ja.properties has the following line:
javax.portlet.title.1_WAR_knowledgebaseportlet=知識ベース管理


Language_en.properties is as follows:
javax.portlet.title.1_WAR_knowledgebaseportlet=Knowledge Base Admin


As you can see, everything message except the title is correctly being used from the Language_ja.properties file.
Attachment

Attachments: knowledgebase.jpg (15.7k)
Hitoshi Ozawa
RE: Translation of Portlet Titles
March 29, 2011 6:18 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Additionally, as you can see from the following screen shot, those without titles defined in Liferay core Language.properties are not translated as well.

I'm wondering is it is being translated in other language environment because I sure haven't seen it translated in other Japanese users' computers as well.
Attachment

Attachments: add.jpg (23.5k)
Hitoshi Ozawa
RE: Translation of Portlet Titles
March 30, 2011 12:24 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

OK, it seems you're not going to able to resolve it here. I'll just resolve it in my build.
Corné Aussems
RE: Translation of Portlet Titles
March 30, 2011 12:51 PM
Answer

Corné Aussems

Rank: Liferay Legend

Posts: 1312

Join Date: October 3, 2006

Recent Posts

Hi Hitoshi ,
We have this 100 Papercuts program.
Maybe you could write up an issue and me or someone else will pick it up next sprint.

Keep up the good work.

Cheers
Hitoshi Ozawa
Resolved: Translation of Portlet Titles
March 30, 2011 2:11 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Corné, this really isn't an issue for the paper cut. It's just testing before releases to make sure both Liferay's and community portlet developers have added codes to get a title name from the Language_xx.properties file.
It's a known issue with a known solution. The problem I think is with the QA.