Skip to content

Commit

Permalink
Changed the label- from-key FTL template to fix expression evaluation…
Browse files Browse the repository at this point in the history
… issues
  • Loading branch information
rousso committed Oct 20, 2023
1 parent a6002f8 commit 4ccc429
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/main/resources/templates/xsl_markup/label_from_key.ftl
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,10 @@
- key: The key to use for rendering
- quantity: If pluralisation is required, then this contains the suffix that identifies the plural form of the label.
-->
<xsl:variable name="key" select="${key}"/>
<#if quantity?has_content>
<xsl:variable name="plural" select="concat(${key}, ted:plural-label-suffix(${quantity}))"/>
<span class="label"><xsl:value-of select="($labels//entry[@key=$plural]/text(), $labels//entry[@key=${key}}]/text(), concat('{', ${key}, '}'))[1]"/></span>
<xsl:variable name="plural" select="concat($key, ted:plural-label-suffix(${quantity}))"/>
<span class="label"><xsl:value-of select="($labels//entry[@key=$plural]/text(), $labels//entry[@key=$key}]/text(), concat('{', $key, '}'))[1]"/></span>
<#else>
<span class="label"><xsl:value-of select="($labels//entry[@key=${key}]/text(), concat('{', ${key}, '}'))[1]"/></span>
<span class="label"><xsl:value-of select="($labels//entry[@key=$key]/text(), concat('{', $key, '}'))[1]"/></span>
</#if>

0 comments on commit 4ccc429

Please sign in to comment.