[yelp-xsl] [gettext] Accept @xml:lang as well as @lang



commit 51c949dff5bc94c978f0802feb710cdaa9d78ca4
Author: brian m. carlson <sandals crustytoothpaste ath cx>
Date:   Sat Apr 10 22:11:15 2010 +0000

    [gettext] Accept @xml:lang as well as @lang
    
    Signed-off-by: brian m. carlson <sandals crustytoothpaste ath cx>

 xslt/gettext/gettext.xsl |   15 ++++++++++-----
 1 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/xslt/gettext/gettext.xsl b/xslt/gettext/gettext.xsl
index daec15a..c4ba9a0 100644
--- a/xslt/gettext/gettext.xsl
+++ b/xslt/gettext/gettext.xsl
@@ -131,7 +131,8 @@ REMARK: Lots of documentation is needed
 -->
 <xsl:template name="l10n.gettext">
   <xsl:param name="msgid"/>
-  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang"/>
+  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang |
+                                 ancestor-or-self::*[ xml:lang][1]/@xml:lang"/>
   <xsl:param name="lang_language">
     <xsl:call-template name="l10n.language">
       <xsl:with-param name="lang" select="$lang"/>
@@ -885,7 +886,8 @@ $lang: The locale to extract the language from
 REMARK: Lots of documentation is needed
 -->
 <xsl:template name="l10n.language">
-  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang"/>
+  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang |
+                                 ancestor-or-self::*[ xml:lang][1]/@xml:lang"/>
   <xsl:choose>
     <xsl:when test="$lang = $l10n.locale">
       <xsl:value-of select="$l10n.language"/>
@@ -914,7 +916,8 @@ $lang: The locale to extract the region from
 REMARK: Lots of documentation is needed
 -->
 <xsl:template name="l10n.region">
-  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang"/>
+  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang |
+                                 ancestor-or-self::*[ xml:lang][1]/@xml:lang"/>
   <xsl:choose>
     <xsl:when test="$lang = $l10n.locale">
       <xsl:value-of select="$l10n.region"/>
@@ -945,7 +948,8 @@ $lang: The locale to extract the variant from
 REMARK: Lots of documentation is needed
 -->
 <xsl:template name="l10n.variant">
-  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang"/>
+  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang |
+                                 ancestor-or-self::*[ xml:lang][1]/@xml:lang"/>
   <xsl:choose>
     <xsl:when test="$lang = $l10n.locale">
       <xsl:value-of select="$l10n.variant"/>
@@ -973,7 +977,8 @@ $lang: The locale to extract the charset from
 REMARK: Lots of documentation is needed
 -->
 <xsl:template name="l10n.charset">
-  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang"/>
+  <xsl:param name="lang" select="ancestor-or-self::*[ lang][1]/@lang |
+                                 ancestor-or-self::*[ xml:lang][1]/@xml:lang"/>
   <xsl:choose>
     <xsl:when test="$lang = $l10n.locale">
       <xsl:value-of select="$l10n.charset"/>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]