9 Replies Latest reply on Feb 9, 2006 10:57 AM by l.forni

    Portlet title

    Balazs Kerekes Newbie

      Multi language portlet title

        • 1. Re: Portlet title
          Balazs Kerekes Newbie


          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?

          • 2. Re: Portlet title
            Viet Master

            can you post in user forum rather ?

            • 3. Re: Portlet title
              Balazs Kerekes Newbie

              Sorry!

              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?

              • 4. Re: Portlet title
                Alexander Grünewald Newbie

                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.

                Best regards,
                Alexander

                • 5. Re: Portlet title
                  l.forni Newbie

                  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!
                  Bye
                  Luca Forni

                  • 6. Re: Portlet title
                    Balazs Kerekes Newbie

                    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. ???

                    • 7. Re: Portlet title
                      l.forni Newbie

                      Would you like to send me your war file with sources? I may take a look at it.

                      If you want, you can send it to me at l.forni@inwind.it

                      • 8. Re: Portlet title
                        Balazs Kerekes Newbie

                        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?

                        • 9. Re: Portlet title
                          l.forni Newbie

                          If you want to localize page name, you have to apply a patch, that you can find here: (i haven't tested yet, probabily i will do it in the next few days)

                          http://jira.jboss.com/jira/browse/JBPORTAL-585