 Rank: Enthusiast
Joined: 11/24/2008 Posts: 37 Location: Odense, Denmark
|
Hi people.
What's the best (and right) way for checking the current language/culture in XSLT? Working on a site with three languages and I need to format dates according to the language in my XSLT. Right now I'm checking for the value in a dictionary item, which isn't a very pretty way to do it. -But it works.
Any ideas?
//Berntsen
|
 Rank: Aficionado
Joined: 4/12/2007 Posts: 112 Location: Amsterdam
|
How is the structure of your multilanguage site? Like 3 root-directories with each directory as a language? If so you could use a check in the XSLT for the parent node like: Code: <xsl:variable name="languageID"> <xsl:choose> <xsl:when test="$currentPage/ancestor-or-self::node/@id = '2708'"> 2927 </xsl:when> <xsl:when test="$currentPage/ancestor-or-self::node/@id = '2709'"> 2967 </xsl:when> <xsl:otherwise> 1250 </xsl:otherwise> </xsl:choose> </xsl:variable>
greetings, Chris
|