Skip to content

Commit

Permalink
Formating changes - mostly spaces to tabs.
Browse files Browse the repository at this point in the history
  • Loading branch information
ianwallen authored and Jesse Eichar committed Jul 2, 2013
1 parent d435722 commit e973677
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 65 deletions.
30 changes: 15 additions & 15 deletions web/src/main/webapp/xsl/test-i18n-xml.xsl
Expand Up @@ -3,23 +3,23 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:exslt="http://exslt.org/common">

<xsl:output method="xml"/>
<xsl:output method="xml"/>

<xsl:variable name="langs">
<langs>
<!-- TODO : add a master lang param to be able to compare to other lang than en <en master="true"/> -->
<fre/>
<spa/>
<chi/>
<ara/>
<ger/>
<ita/>
<rus/>
<dut/>
<por/>
<cat/>
<fin/>
<nor/>
<!-- TODO : add a master lang param to be able to compare to other lang than eng <eng master="true"/> -->
<fre/>
<spa/>
<chi/>
<ara/>
<ger/>
<ita/>
<rus/>
<dut/>
<por/>
<cat/>
<fin/>
<nor/>
</langs>
</xsl:variable>

Expand Down
97 changes: 47 additions & 50 deletions web/src/main/webapp/xsl/test-i18n.xsl
Expand Up @@ -4,23 +4,23 @@
xmlns:exslt="http://exslt.org/common">


<xsl:variable name="langs">
<langs>
<!-- TODO : add a master lang param to be able to compare to other lang than eng <eng master="true"/> -->
<fre/>
<spa/>
<chi/>
<ara/>
<ger/>
<ita/>
<rus/>
<dut/>
<por/>
<xsl:variable name="langs">
<langs>
<!-- TODO : add a master lang param to be able to compare to other lang than eng <eng master="true"/> -->
<fre/>
<spa/>
<chi/>
<ara/>
<ger/>
<ita/>
<rus/>
<dut/>
<por/>
<cat/>
<fin/>
<nor/>
</langs>
</xsl:variable>
<fin/>
<nor/>
</langs>
</xsl:variable>

<xsl:template match="/">
<h1>Test i18n</h1>
Expand Down Expand Up @@ -56,10 +56,10 @@

<table>
<th>
<td width="20px"><b>eng</b></td>
<xsl:for-each select="exslt:node-set($langs)/langs/*">
<td width="20px"><b><xsl:value-of select="name(.)"/></b></td>
</xsl:for-each>
<td width="20px"><b>eng</b></td>
<xsl:for-each select="exslt:node-set($langs)/langs/*">
<td width="20px"><b><xsl:value-of select="name(.)"/></b></td>
</xsl:for-each>
</th>

<!-- FIXME: This loop over xml loc files is not really elegant :( -->
Expand All @@ -84,7 +84,7 @@
<xsl:for-each select="//about.eng/*">
<tr>
<xsl:call-template name="checki18n">
<xsl:with-param name="elem" select="." />
<xsl:with-param name="elem" select="." />
<xsl:with-param name="file">about</xsl:with-param>
</xsl:call-template>
</tr>
Expand All @@ -97,7 +97,7 @@
<xsl:for-each select="//config.eng/*">
<tr>
<xsl:call-template name="checki18n">
<xsl:with-param name="elem" select="." />
<xsl:with-param name="elem" select="." />
<xsl:with-param name="file">config</xsl:with-param>
</xsl:call-template>
</tr>
Expand All @@ -110,7 +110,7 @@
<xsl:for-each select="//harvesting.eng/*">
<tr>
<xsl:call-template name="checki18n">
<xsl:with-param name="elem" select="." />
<xsl:with-param name="elem" select="." />
<xsl:with-param name="file">harvesting</xsl:with-param>
</xsl:call-template>
</tr>
Expand All @@ -120,33 +120,33 @@
</table>


<p>
TODO:
<ul>
<li>Check all elements exist somewhere in XSL files</li>
<li>Check all loc files</li>
<li>Add a master lang parameter</li>
</ul>
</p>
<p>
TODO:
<ul>
<li>Check all elements exist somewhere in XSL files</li>
<li>Check all loc files</li>
<li>Add a master lang parameter</li>
</ul>
</p>
</xsl:template>



<xsl:template name="checki18n">
<xsl:param name="elem"></xsl:param>
<xsl:param name="file"></xsl:param>
<xsl:param name="file"></xsl:param>

<xsl:variable name="tag" select="name($elem)" />
<xsl:variable name="tag" select="name($elem)" />
<xsl:variable name="string" select="$elem/." />
<xsl:variable name="value" select="$elem/@value" />
<xsl:variable name="id" select="$elem/@id" />
<xsl:variable name="type" select="$elem/@type" />
<xsl:variable name="value" select="$elem/@value" />
<xsl:variable name="id" select="$elem/@id" />
<xsl:variable name="type" select="$elem/@type" />


<td title="eng">
<xsl:attribute name="title">
<xsl:value-of select="$string" />
</xsl:attribute>
<xsl:value-of select="$string" />
</xsl:attribute>

<xsl:value-of select="$tag" />
<xsl:if test="$value">
Expand All @@ -159,12 +159,12 @@
<xsl:value-of select="$id" />
)
</xsl:if>
<xsl:if test="$type">
(type:
<xsl:value-of select="$type" />
)
</xsl:if>
</td>
<xsl:if test="$type">
(type:
<xsl:value-of select="$type" />
)
</xsl:if>
</td>
<!-- FIXME: Why can't loop on $la ?
<xsl:for-each select="exslt:node-set($langs)/langs/*">
<td>
Expand Down Expand Up @@ -347,8 +347,6 @@





<xsl:template name="compare">
<xsl:param name="tag"></xsl:param>
<xsl:param name="string"></xsl:param>
Expand Down Expand Up @@ -376,9 +374,9 @@
<xsl:otherwise>
<xsl:choose>
<xsl:when test="$string=''"><!-- Empty tag -->
<xsl:attribute name="bgcolor">green</xsl:attribute>
</xsl:when>
<xsl:when test="count($loctag2[name(.)=$tag])=1">
<xsl:attribute name="bgcolor">green</xsl:attribute>
</xsl:when>
<xsl:when test="count($loctag2[name(.)=$tag])=1">
<xsl:choose>
<xsl:when
test="$loctag2[name(.)=$tag]/. = $string">
Expand Down Expand Up @@ -408,5 +406,4 @@
</xsl:choose>
</xsl:template>


</xsl:stylesheet>

0 comments on commit e973677

Please sign in to comment.