Alimozzaman

Liferay 6 – add a localized variable / localization in theme

Posted on: February 12, 2011

This is a very trivial but then again I want to share as I wasted some time to find this way to add a localization in my theme.

Step#1:  Set a  key in a variable into your init_custom.vm

#set ($a = $languageUtil.get($locale, “my-picture”))

step#2: Use the variable into your *.vm files

<span>$a</span>

step#3:  Add the corresponding value of the key  “my-picture” into your language file.

Ex- my-picture= <localized text>

Here you go… Very simple!

 

Advertisements

1 Response to "Liferay 6 – add a localized variable / localization in theme"

Do I need to define $locale variable in init?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s

Top Rated

Advertisements
%d bloggers like this: