Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Included from
Source
Stylesheet i18n_xsl.xsl
Included from
Stylesheet version 1.0
Template getLabel
Documentation

Description

 #H4# TEMPLATES 
Namespace No namespace
Used by
References
Variables
Parameters
QName Namespace
aLang No namespace
aList No namespace
aVal No namespace
Import precedence 0
Source
<xsl:template name="getLabel">
  <!--Cmt: $aList : for labels in list -->
  <xsl:param name="aList"/>
  <!--Cmt: $aVal : key -->
  <xsl:param name="aVal"/>
  <!--Cmt: $aLang : optional 'lang' parameter -->
  <xsl:param name="aLang"/>
  <!--Cmt: convert $aVal to string  -->
  <xsl:variable name="iKey" select="string($aVal)"/>
  <xsl:variable name="iLang">
    <xsl:choose>
      <xsl:when test="'' != $aLang">
        <xsl:value-of select="$aLang"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="$vLang"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="iLg" select="substring($iLang, 1, 2)"/>
  <xsl:variable name="getLabel_res">
    <xsl:choose>
      <xsl:when test="'' != $aList and $vLabels/i_d:lb[@l = $aList and @k = $iKey]/*[local-name() = $iLang]">
        <xsl:value-of select="$vLabels/i_d:lb[@l = $aList and @k = $iKey]/*[local-name() = $iLang]"/>
      </xsl:when>
      <xsl:when test="'' != $aList and $vLabels/i_d:lb[@l = $aList and @k = $iKey]/*[local-name() = $iLg]">
        <xsl:value-of select="$vLabels/i_d:lb[@l = $aList and @k = $iKey]/*[local-name() = $iLg]"/>
      </xsl:when>
      <xsl:when test="$vLabels/i_d:lb[@k = $iKey]/*[local-name() = $iLang]">
        <xsl:value-of select="$vLabels/i_d:lb[@k = $iKey]/*[local-name() = $iLang]"/>
      </xsl:when>
      <xsl:when test="$vLabels/i_d:lb[@k = $iKey]/*[local-name() = $iLg]">
        <xsl:value-of select="$vLabels/i_d:lb[@k = $iKey]/*[local-name() = $iLg]"/>
      </xsl:when>
      <xsl:when test="$vLabels/i_d:lb[@k = $iKey]/fr">
        <xsl:value-of select="$vLabels/i_d:lb[@k = $iKey]/fr"/>
      </xsl:when>
      <xsl:when test="'' != $iKey">
        <xsl:value-of select="$iKey"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>Clef Vide</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:value-of select="$getLabel_res"/>
</xsl:template>
Template dbg-i18n
Namespace No namespace
References
Variable
Template
Import precedence 0
Source
<xsl:template name="dbg-i18n">
  <pre title="test i18n">
    <dbg-vLabels>
      <xsl:copy-of select="$vLabels"/>
    </dbg-vLabels>
    <p>
      <xsl:call-template name="getLabel">
        <xsl:with-param name="aLang">fr</xsl:with-param>
        <xsl:with-param name="aList">credit_status_list_type</xsl:with-param>
        <xsl:with-param name="aVal">new</xsl:with-param>
      </xsl:call-template>
    </p>
  </pre>
</xsl:template>
Variable vLang
Documentation

Description

 #H4# VARIABLES I18N 
Namespace No namespace
Used by
Templates
Variable
Source
<xsl:variable name="vLang">
  <!--cmt $vLang :document lang or user interface lang ? -->
  <xsl:choose>
    <xsl:when test="'' != /ce:ClicEdit/@lang">
      <xsl:value-of select="string(/ce:ClicEdit/@lang)"/>
    </xsl:when>
    <xsl:otherwise>fr</xsl:otherwise>
  </xsl:choose>
</xsl:variable>
Variable vLg
Namespace No namespace
Used by
References
Variable
Source
<xsl:variable name="vLg">
  <!--cmt $vLg : 1st part on 2 chars -->
  <xsl:choose>
    <xsl:when test="string-length($vLang) > 2">
      <xsl:value-of select="substring($vLang, 1, 2)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$vLang"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:variable>
Variable vLabels
Namespace No namespace
Select document('i18n_xml.xml')/i_d:labels
Used by
Templates
Source
<xsl:variable name="vLabels" select="document('i18n_xml.xml')/i_d:labels"/>