1
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
<!-- Enigma i18n level string extractor for gettext -->
3
<!-- Copyright (c) 2006 Ronald Lamprecht -->
5
<!-- Usage: Xalan -v level.xml i18n.xsl > po/level_i18n.cc -->
6
<!-- Note: the schema level.xsd must be locatable for parsing level.xml -->
7
<!-- without a resolver the schema must be copied into the same dir as level.xml -->
8
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:el="http://enigma-game.org/schema/level/1">
9
<xsl:output method="text" indent="no"/>
11
<xsl:template match="/">
12
<xsl:apply-templates select="el:level/el:protected/el:info/el:identity"/>
13
<xsl:apply-templates select="el:level/el:protected/el:info/el:author"/>
14
<xsl:apply-templates select="el:level/el:protected/el:i18n/el:string"/>
17
<xsl:template match="el:author">
18
<xsl:text>//author# author: "</xsl:text>
19
<xsl:value-of select="@el:name"/>
20
<xsl:text>" email "</xsl:text>
21
<xsl:value-of select="@el:email"/>
22
<xsl:text>"
</xsl:text>
25
<xsl:template match="el:identity">
26
<xsl:text>
//level# level: "</xsl:text>
27
<xsl:value-of select="@el:title"/>
28
<xsl:text>"
</xsl:text>
31
<xsl:template match="/el:level/el:protected/el:i18n/el:string">
32
<xsl:if test="el:english/@el:translate='true'">
33
<xsl:if test="@el:key='title'">
34
<xsl:apply-templates select="el:english/@el:comment"/>
35
<xsl:apply-templates select="el:translation"/>
36
<xsl:apply-templates select="id(@el:key)"/>
37
<xsl:text>gettext("</xsl:text>
38
<xsl:value-of select="/el:level/el:protected/el:info/el:identity/@el:title"/>
39
<xsl:text>")
</xsl:text>
41
<xsl:if test="@el:key='subtitle' and /el:level/el:protected/el:info/el:identity/@el:subtitle!=''">
42
<xsl:apply-templates select="el:english/@el:comment"/>
43
<xsl:apply-templates select="el:translation"/>
44
<xsl:apply-templates select="id(@el:key)"/>
45
<xsl:text>gettext("</xsl:text>
46
<xsl:value-of select="/el:level/el:protected/el:info/el:identity/@el:subtitle"/>
47
<xsl:text>")
</xsl:text>
49
<xsl:if test="@el:key!='title' and @el:key!='subtitle'">
50
<xsl:apply-templates select="el:english/@el:comment"/>
51
<xsl:apply-templates select="el:translation"/>
52
<xsl:apply-templates select="id(@el:key)"/>
53
<xsl:text>gettext("</xsl:text>
54
<xsl:value-of select="el:english"/>
55
<xsl:text>")
</xsl:text>
60
<xsl:template match="@el:comment">
61
<xsl:text>//comment# comment: "</xsl:text>
62
<xsl:value-of select="."/>
63
<xsl:text>"
</xsl:text>
66
<xsl:template match="/el:level/el:protected/el:i18n/el:string/el:translation">
67
<xsl:text>//</xsl:text>
68
<xsl:value-of select="@el:lang"/>
69
<xsl:text># use: "</xsl:text>
70
<xsl:value-of select="."/>
71
<xsl:text>"
</xsl:text>
74
<xsl:template match="/el:level/el:public/el:i18n/el:string">
75
<xsl:apply-templates select="el:translation"/>
78
<xsl:template match="/el:level/el:public/el:i18n/el:string/el:translation">
79
<xsl:text>//</xsl:text>
80
<xsl:value-of select="@el:lang"/>
81
<xsl:text># check: "</xsl:text>
82
<xsl:value-of select="."/>
83
<xsl:text>"
</xsl:text>