~ubuntu-branches/ubuntu/trusty/enigma/trusty-proposed

« back to all changes in this revision

Viewing changes to tools/i18n.xsl

  • Committer: Package Import Robot
  • Author(s): Erich Schubert
  • Date: 2013-04-06 14:54:02 UTC
  • mfrom: (1.1.10)
  • Revision ID: package-import@ubuntu.com-20130406145402-jgjrtk7hac8gtvza
Tags: 1.20-dfsg.1-1
* New upstream release (Closes: #704595)
  (Repacked: dropped zipios++ source and main menu music)
* Update watch file, sf.net again.
* Fix documentation links (Closes: #653508)
* Conflict with enigma-level-previews to encourage deinstallation
  (Pregenerated level previews were only used with version 1.01)
* Use dh7 for building instead of CDBS
* Update to policy 3.9.4.0 (no changes)
* Register documentation with doc-base

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
2
 
<!-- Enigma i18n level string extractor for gettext -->
3
 
<!-- Copyright (c) 2006 Ronald Lamprecht -->
4
 
<!-- License: GPL2 -->
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"/>
10
 
 
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"/>
15
 
  </xsl:template>
16
 
 
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>"&#xA;</xsl:text>
23
 
  </xsl:template>
24
 
  
25
 
  <xsl:template match="el:identity">
26
 
    <xsl:text>&#xA;//level#  level: "</xsl:text>
27
 
    <xsl:value-of select="@el:title"/>
28
 
    <xsl:text>"&#xA;</xsl:text>
29
 
  </xsl:template>
30
 
  
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>")&#xA;</xsl:text>
40
 
      </xsl:if>
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>")&#xA;</xsl:text>
48
 
      </xsl:if>
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>")&#xA;</xsl:text>
56
 
      </xsl:if>
57
 
    </xsl:if>
58
 
  </xsl:template>
59
 
  
60
 
  <xsl:template match="@el:comment">
61
 
    <xsl:text>//comment#  comment: "</xsl:text>
62
 
    <xsl:value-of select="."/>
63
 
    <xsl:text>"&#xA;</xsl:text>
64
 
  </xsl:template>
65
 
  
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>"&#xA;</xsl:text>
72
 
  </xsl:template>
73
 
  
74
 
  <xsl:template match="/el:level/el:public/el:i18n/el:string">
75
 
    <xsl:apply-templates select="el:translation"/>
76
 
  </xsl:template>
77
 
  
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>"&#xA;</xsl:text>
84
 
  </xsl:template>
85
 
  
86
 
</xsl:stylesheet>