Portlet title - using common resource bundle for all portlets

sanjay datta, modified 13 Years ago. New Member Posts: 19 Join Date: 2/5/11 Recent Posts
Hi,

We use a common resource bundle containing translatable strings for 8 different languages

mycompany_en_US.properties
mycompany_es_US.properties
...
...
...

i have 3 portlets and i have defined resource bundle in portlet.xml
<resource-bundle>mycompany</resource-bundle>

As per the documentation each resource bundle can i have one entry for javax.portlet.title.

As i have 3 portlets with different titles using a common resource bundle. How do i define different titles for each of my portlet in resourcebundle and reference them in portlet.xml
thumbnail
Pinkesh Gandhi, modified 13 Years ago. Junior Member Posts: 99 Join Date: 1/27/12 Recent Posts
Hi Sanjay,

Please try with following concept, hope it may helps you

javax.portlet.title.<portlet-id>=Portlet Title

For e.g.,

javax.portlet.title.my-portlet=My Test Portlet
sanjay datta, modified 13 Years ago. New Member Posts: 19 Join Date: 2/5/11 Recent Posts
Thanks Pinkesh,

I am assuming the protlet-id is as defined for individual portlets in liferay-display.xml
thumbnail
Hitoshi Ozawa, modified 13 Years ago. Liferay Legend Posts: 7942 Join Date: 3/24/10 Recent Posts
Portlet id is the name declared in the portlet.xml.

e.g. In the following example from liferay's portlet-custom.xml, portlet-id is 2.
<portlet-name>2</portlet-name>
sanjay datta, modified 13 Years ago. New Member Posts: 19 Join Date: 2/5/11 Recent Posts
Thank you.
How do i achieve the same for Site page name ?.

I have created a site with private and public pages. I would like to derive the name of the page from the custom resource bundle
thumbnail
Pinkesh Gandhi, modified 13 Years ago. Junior Member Posts: 99 Join Date: 1/27/12 Recent Posts
Hi Sanjay,

If you want to create site pages through portal UI then it is not possible.

You must have to pass required values manually in UI at the time of page creation.

But if you are trying to create site pages through your code then you can do it by reading property file.

I hope it might resolved your query.
sanjay datta, modified 13 Years ago. New Member Posts: 19 Join Date: 2/5/11 Recent Posts
I have 1 WAR 1 portlet.xml with multiple portlets and according to following documentation

http://www.liferay.com/es/community/wiki/-/wiki/Main/Portlet+Localization+-+Outside+Liferay#section-Portlet+Localization+-+Outside+Liferay-Portlet+Title

i need to have resource bundle for each portlets. Is there a way i can get it to work with common resource bundle ?