Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Saikat Saha
Language Display Customization
November 21, 2012 10:42 PM
Answer

Saikat Saha

Rank: New Member

Posts: 22

Join Date: November 16, 2011

Recent Posts

Hi,

I have requirement to customize the display of language options. It should show only the other available language options excluding the current language of the Portal.

For example if my portal is having the English, Hindi and Bengali language options and default language is English, then at first only Hindi & Bengali options should be displayed. Now if I select the Hindi language to display the Portal, then it should display only the English & Bengali options.

Please guide me, whether it requires a hook or not. If hooking is required where do I need to change to get the expected customization.

Regards,
Juhi Kumari
RE: Language Display Customization
November 21, 2012 11:04 PM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi,
Set locales value in your portal-ext.properties file acording to your requirement.
1locales=en_US,de_DE,es_ES



Regards
Juhi
Saikat Saha
RE: Language Display Customization
November 21, 2012 11:46 PM
Answer

Saikat Saha

Rank: New Member

Posts: 22

Join Date: November 16, 2011

Recent Posts

Hi Juhi,

This is okay for me. But I think you have not got my point exactly. I already have all of my required languages option in the portal. But I want exclude the current language (which is selected) from the display options. All others will be there. So I need help in this area.

Thanks.
Juhi Kumari
RE: Language Display Customization
November 22, 2012 12:59 AM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi Saikat,

For this you have to customize taglib/ui/language/page.jsp Using if condition you can select current language and display the rest.


Regards
Juhi
Vishal Panchal
RE: Language Display Customization
November 22, 2012 1:16 AM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Juhi Kumari:
Hi Saikat,

For this you have to customize taglib/ui/language/page.jsp Using if condition you can select current language and display the rest.


Regards
Juhi


Hi Juhi ,

I have the same requirement and I have made hook for two pages

language/view.jsp
and
taglib/ui/language/page.jsp

but page.jsp customization is not giving any effect.

can you please guide me..?

Thanks,
Vishal R. Panchal
Vishal Panchal
RE: Language Display Customization
November 22, 2012 1:48 AM
Answer

Vishal Panchal

Rank: Expert

Posts: 277

Join Date: May 20, 2012

Recent Posts

Juhi Kumari:
Hi Saikat,

For this you have to customize taglib/ui/language/page.jsp Using if condition you can select current language and display the rest.


Regards
Juhi


Hi Juhi,

It worked ..!
Thank you..!

Regards,
Vishal
Sujay Kumar Paul
RE: Language Display Customization
November 22, 2012 2:44 AM
Answer

Sujay Kumar Paul

Rank: Regular Member

Posts: 165

Join Date: October 28, 2011

Recent Posts

Hi every body

Please tell me how to find the selected language

Thanks in advance
Hiral Barot
RE: Language Display Customization
November 22, 2012 3:31 AM
Answer

Hiral Barot

Rank: New Member

Posts: 17

Join Date: January 3, 2012

Recent Posts

Hi Sujay,

You can get it from request :

renderRequest.getLocale();
Juhi Kumari
RE: Language Display Customization
November 22, 2012 4:50 AM
Answer

Juhi Kumari

Rank: Expert

Posts: 347

Join Date: December 12, 2011

Recent Posts

Hi Sujay,

Get the selected language using themeDisplay object, which is available in all jsp of portal.
1themeDisplay.getLocale()


Regards
Juhi
Saikat Saha
RE: Language Display Customization
November 22, 2012 9:50 PM
Answer

Saikat Saha

Rank: New Member

Posts: 22

Join Date: November 16, 2011

Recent Posts

Thanks to all of you. Its done.
Sujay Kumar Paul
RE: Language Display Customization
November 28, 2012 3:04 AM
Answer

Sujay Kumar Paul

Rank: Regular Member

Posts: 165

Join Date: October 28, 2011

Recent Posts

Thanks Every one.
Its working.