Translation of javax.portlet.display-name

E W, modificat fa 8 anys. New Member Apunts: 3 Data d'incorporació: 05/09/12 Publicacions recents
How can I translate the value of the property javax.portlet.display-name?
In this article I read

Note the value of the javax.portlet.display-name property: Guestbooks. This is the name that appears in the Site menu.


I've searched quite a bit of time to get a clue, but found nothing yet.
thumbnail
David H Nebinger, modificat fa 8 anys. Liferay Legend Apunts: 14933 Data d'incorporació: 02/09/06 Publicacions recents
When set in the properties of the @Component for the portlet class, there is no way to localize the value.

However, you can have a resource bundle in the bundle with keys like:

javax.portlet.display-name.<portlet-name>=Localizable Portlet Display Name</portlet-name>


Since it is in a resource bundle, it is now localizable.

If you use the Blade CLI or the Liferay IDE to create a new portlet from the LiferayMVC portlet type, you'll get the starter resource bundle you need.
E W, modificat fa 8 anys. New Member Apunts: 3 Data d'incorporació: 05/09/12 Publicacions recents
Hi David,

Thanks for your message. Unfortunately it doesn't work for me (yet). I tried several things:

  • Removed the display-name in the @Component section.
  • Added a javax.portlet.display-name.<portlet-name> property in the Language.properties files (src/main/resources/content/Language.properties). This is referenced in the @Component section with "javax.portlet.resource-bundle=content.Language"


That didn't do the trick, so I tried adding the package name to the <portlet-name>, package name parts separated with periods as well as with underscores like so:

javax.portlet.display-name.packagenamepart1.packagenamepart2.PortletName =
javax.portlet.display-name.packagenamepart1_packagenamepart2_PortletName =

But that didn't work either.

I must be missing something here I guess, do you have another suggestion/clue for me?
E W, modificat fa 8 anys. New Member Apunts: 3 Data d'incorporació: 05/09/12 Publicacions recents
David H Nebinger:

javax.portlet.display-name.<portlet-name>=Localizable Portlet Display Name</portlet-name>



David, you were almost right...but it's not
javax.portlet.display-name.<portlet-name> = Localizable Portlet Name</portlet-name>

but
javax.portlet.title.<portlet-name> = Localizable Portlet Name</portlet-name>
for the portlet's name as shown in the 'Add Applications' list.

But thanks anyway!
thumbnail
David H Nebinger, modificat fa 8 anys. Liferay Legend Apunts: 14933 Data d'incorporació: 02/09/06 Publicacions recents
Well, you asked for how to translate display name, not title...

emoticon