Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
sanjay datta
Portlet title - using common resource bundle for all portlets
July 24, 2012 9:59 AM
Answer

sanjay datta

Rank: New Member

Posts: 19

Join Date: February 5, 2011

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
Pinkesh Gandhi
RE: Portlet title - using common resource bundle for all portlets
July 24, 2012 10:06 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

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
RE: Portlet title - using common resource bundle for all portlets
July 24, 2012 10:18 AM
Answer

sanjay datta

Rank: New Member

Posts: 19

Join Date: February 5, 2011

Recent Posts

Thanks Pinkesh,

I am assuming the protlet-id is as defined for individual portlets in liferay-display.xml
Hitoshi Ozawa
RE: Portlet title - using common resource bundle for all portlets
July 24, 2012 3:39 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

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>
Pinkesh Gandhi
RE: Portlet title - using common resource bundle for all portlets
July 25, 2012 12:50 AM
Answer

Pinkesh Gandhi

Rank: Regular Member

Posts: 100

Join Date: January 26, 2012

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
RE: Portlet title - using common resource bundle for all portlets
July 25, 2012 9:48 AM
Answer

sanjay datta

Rank: New Member

Posts: 19

Join Date: February 5, 2011

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 ?