Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Daniel Rodriguez
(RESOLVED) Languages in XSL template
February 13, 2008 3:49 AM
Answer

Daniel Rodriguez

Rank: Junior Member

Posts: 38

Join Date: August 9, 2006

Recent Posts

Hello all,

I'm developing some templates in XSL and I need to write some static text on them that will change depending on the language selected. For example I have to write "Last update: XX/XX/XXXX" and last update should be in french, german... and so on.

How can I know inside the template with is the user language?

Thanks in advance!
Ray Augé
Re: [Liferay Forums][4. Custom Theme Development]Languages in XSL template
February 11, 2008 7:56 AM
Answer

Ray Augé

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1238

Join Date: February 7, 2005

Recent Posts

> How can I know inside the template with is the user language?


The token @language_id@ will contain the string value of the current
locale (based on the request, portal default, user's preference):

1<xsl:variable name="locale" select="'@language_id@'" />
2<xsl:value-of select="$locale" />


will emit (by default):

1en_US



Hope that helps!
Daniel Rodriguez
RE: Re: [Liferay Forums][4. Custom Theme Development]Languages in XSL templ
February 11, 2008 8:51 AM
Answer

Daniel Rodriguez

Rank: Junior Member

Posts: 38

Join Date: August 9, 2006

Recent Posts

Thank you really much! It works!

Really fast answer and really useful! emoticon
jeff gerbracht
RE: Re: [Liferay Forums][4. Custom Theme Development]Languages in XSL templ
December 9, 2008 12:53 PM
Answer

jeff gerbracht

Rank: Junior Member

Posts: 64

Join Date: June 5, 2008

Recent Posts

I'm doing something similar and would like to look the display values up from the translation properties files

Liferay_(Language code)-ext.properties

Anyone know how this can be done in an XSL template?
Thanks
Jeff