We are using JBoss Portal 2.2 as a portal server. The portal displays the title of portlet in portlet window and menu bar too, which is defined in portlet.xml file <portlet-info> tag.
How can I define a multi language title in a portlet?
can you post in user forum rather ?
So, how can I define multi language title in a portlet? Is it possible to use any properties file? Or if I have to use portlet.xml file, then how can I do it in?
Wouldn't it be a good option to make the portlets display title editable in the management portlet? So the portal administrator could easily edit it. For instance i would like to customize the display title of the "User portlet" to "Log In" or so.
You can localize portlet title in two ways:
1) add this to portlet.xml:
<supported-locale>en</supported-locale> <supported-locale>it</supported-locale> <resource-bundle>localizationportlet.nl.LocalizationPortletPortletResource</resource-bundle>
You can put any supported locale that you want, and define a ResourceBundle that must be in the classpath of the portlet (tipically deployed with java src of the portlet)
Then you have to add these key to the ResourceBundle that you have defined in portlet.xml
javax.portlet.title=LocalizationPortlet portlet javax.portlet.short-title= javax.portlet.keywords=
2) the second way to do this it to add some tag in portlet.xml like this:
<portlet> <description xml:lang="en">Test for Localization</description> <portlet-name>LocalizationPortlet</portlet-name> <display-name>LocalizationPortlet portlet</display-name> <display-name xml:lang="en">LocalizationPortlet portlet</display-name> <portlet-class>localizationportlet.LocalizationPortletPortlet</portlet-class> ...
Hope that helps you!
Thanks in advance!
The solution is what I tried, but it does'n work for me. I prefer the first solution.
The *.properties files in the classpath, under WEB-INF/classes, and when I deploy the portlet, it looks like found it.
I don't understand where is the problem. ???
I will send it, if I cannot solve the problem. It's interesting, but I define the title in portlet.xml file in portlet-info tag, and it isn't shown in title. In menubar and in pages portlet, the <page-name> from *-object.xml displayed. Do you have any idea?