Skip to content

Commit

Permalink
If available, use better-name="..." from info.xml as language name
Browse files Browse the repository at this point in the history
  • Loading branch information
howlger committed Apr 30, 2022
1 parent 3596a95 commit 7239509
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion transform_to_plugin_snippet.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,22 @@
<!-- content types -->
<extension point="org.eclipse.core.contenttype.contentTypes">
<xsl:for-each select="exsl:node-set($languages)/o">
<xsl:variable name="original-name" select="a[@name='aliases']/v[1]/@string"/>
<xsl:variable name="name">
<xsl:choose>
<xsl:when test="document($info-file)/info/extension[@id = $extension]
/language[@name = $original-name][@better-name]">
<xsl:value-of select="document($info-file)/info/extension[@id = $extension]
/language[@name = $original-name]/@better-name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$original-name"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<content-type id="lng.{e[@name='id']/@string}"
base-type="de.agilantis.language_pack.basetype"
name="{a[@name='aliases']/v[1]/@string} (Syntax Highlighting)"
name="{$name} (Syntax Highlighting)"
priority="low">

<!-- file-extensions="..." -->
Expand Down

0 comments on commit 7239509

Please sign in to comment.