tags:

views:

14

answers:

2

I'd like to be able to conditionally include a different header file based on the requested content language.

Something like the pseudocode below

#if (language is english)
  #parse ("header_english.vm")
#end

How would you do that in Liferay?

+1  A: 

use themeDisplay.getLocale() is you are using jsps

check http://www.liferay.com/community/forums/-/message_boards/message/4148692

Andy Lin
Works grand thanks!
L. De Leo
A: 

Tf this is part of your theme you can simply use the pre-defined variable $locale

#if ($locale = "en_US") 
  #parse ("header_english.vm")
#end

You might probably just want to test for the first 2 characters (i.e. the language) rather than the whole locale.

a_horse_with_no_name