Planned maintenance is scheduled for the week of June 15th - the exact date and time will be announced soon.
See More Details
Ask Questions and Find Answers
Important:
Ask is now read-only. You can review any existing questions and answers, but not add anything new.
But - don't panic! While ask is no more, we've replaced it with discuss - the new Liferay Discussion Forum! Read more here here or just visit the site here:
discuss.liferay.com
Translation of javax.portlet.display-name
How can I translate the value of the property javax.portlet.display-name?
In this article I read
I've searched quite a bit of time to get a clue, but found nothing yet.
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.
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:
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.
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.
Hi David,
Thanks for your message. Unfortunately it doesn't work for me (yet). I tried several things:
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?
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?
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!
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...
Community
Company
Feedback