Browse Source

cleaned up the 'little words' translation system, made it work with backup English copies

svn path=/trunk/; revision=19300
pull/8/head
nicoulas 10 years ago
parent
commit
a1797267dc
35 changed files with 159 additions and 55 deletions
  1. +1
    -1
      about/de/germany.xsl
  2. +17
    -6
      about/gb/gb.xsl
  3. +1
    -1
      about/legal/de/de.xsl
  4. +0
    -1
      about/members.xsl
  5. +1
    -1
      about/people2/all.xsl
  6. +1
    -1
      about/printable/printable.xsl
  7. +1
    -2
      about/team.xsl
  8. +0
    -1
      campaigns/pdfreaders/buglist.xsl
  9. +0
    -1
      campaigns/pdfreaders/pdfreaders.xsl
  10. +1
    -1
      documents/documents.xsl
  11. +0
    -1
      donate/thankgnus-2001.xsl
  12. +0
    -1
      donate/thankgnus-2002.xsl
  13. +0
    -1
      donate/thankgnus-2003.xsl
  14. +0
    -1
      donate/thankgnus-2004.xsl
  15. +0
    -1
      donate/thankgnus-2005.xsl
  16. +0
    -1
      donate/thankgnus-2006.xsl
  17. +0
    -1
      donate/thankgnus-2007.xsl
  18. +0
    -1
      donate/thankgnus-2008.xsl
  19. +0
    -1
      donate/thankgnus-2009.xsl
  20. +0
    -1
      donate/thankgnus-2010.xsl
  21. +1
    -2
      donate/thankgnus.xsl
  22. +26
    -10
      index.xsl
  23. +0
    -1
      news/newsletter.xsl
  24. +0
    -1
      order/order.xsl
  25. +0
    -1
      orders/order.xsl
  26. +0
    -1
      press/press.xsl
  27. +0
    -1
      projects/finished.xsl
  28. +0
    -1
      projects/inactive.xsl
  29. +1
    -1
      projects/map/de/de.xsl
  30. +1
    -2
      projects/projects.xsl
  31. +1
    -1
      projects/swpat/documents.xsl
  32. +1
    -1
      projects/wipo/wipo.xsl
  33. +20
    -5
      tools/build.pl
  34. +68
    -1
      tools/xsltsl/tagging.xsl
  35. +17
    -0
      tools/xsltsl/translations.xsl

+ 1
- 1
about/de/germany.xsl View File

@ -57,7 +57,7 @@
</xsl:call-template>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<!-- For all other nodes, copy verbatim -->


+ 17
- 6
about/gb/gb.xsl View File

@ -6,6 +6,7 @@
<xsl:import href="../../tools/xsltsl/tagging.xsl" />
<xsl:import href="../../tools/xsltsl/countries.xsl" />
<xsl:import href="../../tools/xsltsl/translations.xsl" />
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<!-- To localise this page to a new country, copy this file and change the following:
@ -23,27 +24,37 @@
<!--translated word "news"-->
<xsl:template match="news-label">
<xsl:apply-templates select="/html/textset-content/text[@id='news']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'news'" />
</xsl:call-template>
</xsl:template>
<!--translated word "events"-->
<xsl:template match="events-label">
<xsl:apply-templates select="/html/textset-content/text[@id='events']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'events'" />
</xsl:call-template>
</xsl:template>
<!--translated word "microblog"-->
<xsl:template match="microblog-label">
<xsl:apply-templates select="/html/textset-content/text[@id='microblog']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'microblog'" />
</xsl:call-template>
</xsl:template>
<!--translated word "contact"-->
<xsl:template match="contact-label">
<xsl:apply-templates select="/html/textset-content/text[@id='contact']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'contact'" />
</xsl:call-template>
</xsl:template>
<!--translated word "team"-->
<xsl:template match="team-label">
<xsl:apply-templates select="/html/textset-content/text[@id='team']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'team'" />
</xsl:call-template>
</xsl:template>
<!--define contact information-->
@ -135,7 +146,7 @@
</xsl:call-template>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<!-- For all other nodes, copy verbatim -->


+ 1
- 1
about/legal/de/de.xsl View File

@ -15,7 +15,7 @@
</xsl:element>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<!-- For all other nodes, copy verbatim -->


+ 0
- 1
about/members.xsl View File

@ -45,7 +45,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 1
- 1
about/people2/all.xsl View File

@ -138,7 +138,7 @@
</div>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set" />
<!-- For all other nodes, copy verbatim -->


+ 1
- 1
about/printable/printable.xsl View File

@ -128,7 +128,7 @@
</xsl:for-each>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set" />
<!-- For all other nodes, copy verbatim -->


+ 1
- 2
about/team.xsl View File

@ -18,9 +18,8 @@
</xsl:call-template>
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
campaigns/pdfreaders/buglist.xsl View File

@ -86,7 +86,6 @@
<!-- Do not copy <set> and <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
campaigns/pdfreaders/pdfreaders.xsl View File

@ -57,7 +57,6 @@
<!-- Do not copy <set> and <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 1
- 1
documents/documents.xsl View File

@ -39,7 +39,7 @@
</xsl:element>
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<!-- Do not copy <set> to output at all -->
<xsl:template match="set" />
<!-- For all other nodes, copy verbatim -->


+ 0
- 1
donate/thankgnus-2001.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2002.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2003.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2004.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2005.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2006.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2007.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2008.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2009.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
donate/thankgnus-2010.xsl View File

@ -38,7 +38,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 1
- 2
donate/thankgnus.xsl View File

@ -48,9 +48,8 @@
</xsl:choose>
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 26
- 10
index.xsl View File

@ -6,6 +6,7 @@
<xsl:import href="tools/xsltsl/date-time.xsl" />
<xsl:import href="tools/xsltsl/tagging.xsl" />
<xsl:import href="tools/xsltsl/translations.xsl" />
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<!--
@ -61,37 +62,51 @@
<!--translated word "newsletter"-->
<xsl:template match="newsletter-label">
<xsl:apply-templates select="/html/textset-content/text[@id='newsletter']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'newsletter'" />
</xsl:call-template>
</xsl:template>
<!--translated sentence "receive-newsletter"-->
<xsl:template match="receive-newsletter">
<xsl:apply-templates select="/html/textset-content/text[@id='receive-newsletter']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'receive-newsletter'" />
</xsl:call-template>
</xsl:template>
<!--translated word "news"-->
<xsl:template match="news-label">
<xsl:apply-templates select="/html/textset-content/text[@id='news']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'news'" />
</xsl:call-template>
</xsl:template>
<!--translated word "events"-->
<xsl:template match="events-label">
<xsl:apply-templates select="/html/textset-content/text[@id='events']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'events'" />
</xsl:call-template>
</xsl:template>
<!--translated word "more"-->
<xsl:template match="more-label">
<xsl:apply-templates select="/html/textset-content/text[@id='more']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'more'" />
</xsl:call-template>
</xsl:template>
<!--translated word "donate"-->
<xsl:template match="donate-label">
<xsl:apply-templates select="/html/textset-content/text[@id='donate']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'donate'" />
</xsl:call-template>
</xsl:template>
<!--translated word "join"-->
<xsl:template match="join-label">
<xsl:apply-templates select="/html/textset-content/text[@id='join']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'join'" />
</xsl:call-template>
</xsl:template>
<!--generate subscribe button in correct language-->
@ -100,15 +115,16 @@
<xsl:attribute name="id">submit</xsl:attribute>
<xsl:attribute name="type">submit</xsl:attribute>
<xsl:attribute name="value">
<xsl:apply-templates select="/html/textset-content/text[@id='subscribe']/node()"/>
<xsl:call-template name="gettext">
<xsl:with-param name="id" select="'subscribe'" />
</xsl:call-template>
</xsl:attribute>
</xsl:element>
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="textset-content"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">
<xsl:copy>


+ 0
- 1
news/newsletter.xsl View File

@ -40,7 +40,6 @@
</xsl:template>
<xsl:template match="set"/>
<xsl:template match="text"/>
</xsl:stylesheet>

+ 0
- 1
order/order.xsl View File

@ -95,7 +95,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
orders/order.xsl View File

@ -95,7 +95,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
press/press.xsl View File

@ -36,7 +36,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
projects/finished.xsl View File

@ -28,7 +28,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 0
- 1
projects/inactive.xsl View File

@ -28,7 +28,6 @@
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 1
- 1
projects/map/de/de.xsl View File

@ -13,7 +13,7 @@
</xsl:for-each>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set"/>
<!-- For all other nodes, copy verbatim -->


+ 1
- 2
projects/projects.xsl View File

@ -26,9 +26,8 @@
</xsl:for-each>
</xsl:template>
<!-- Do not copy <set> or <text> to output at all -->
<!-- Do not copy <set> to output at all -->
<xsl:template match="set"/>
<xsl:template match="text"/>
<!-- For all other nodes, copy verbatim -->
<xsl:template match="@*|node()" priority="-1">


+ 1
- 1
projects/swpat/documents.xsl View File

@ -38,7 +38,7 @@
</xsl:element>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set" />
<!-- For all other nodes, copy verbatim -->


+ 1
- 1
projects/wipo/wipo.xsl View File

@ -38,7 +38,7 @@
</xsl:element>
</xsl:template>
<!-- Do not copy <set> to output at all -->
<!-- Do not copy <set> or <text> to output at all -->
<xsl:template match="set" />
<!-- For all other nodes, copy verbatim -->


+ 20
- 5
tools/build.pl View File

@ -519,12 +519,27 @@ sub process {
$textlang = "en";
}
# TODO: backup texts?
my $textdoc = $sourcedoc->createElement("textset-content");
$sourcedoc->documentElement->appendChild($textdoc);
$auto_data->appendChild($textdoc);
clone_document($textdoc, $opts{i}."/tools/texts-content-$textlang.xml");
# Get also backup texts from the English file
my $textdocbak = $sourcedoc->createElement("textset-content-backup");
$auto_data->appendChild($textdocbak);
clone_document($textdocbak, $opts{i}."/tools/texts-content-en.xml");
# TODO: optimise getting texts-content-xx.xml and texts-content-en.xml,
# since it does not depend on the xsl file being treated, we should do it only once!
if ( $lang eq "cs" ) {
print "--->outputting test.xml\n";
open (TEST, '>', "/home/nicolas/FSFE/fsfe-web-out/test.xml");
print TEST $sourcedoc->toString();
close (TEST);
}
#
# Transform the document using the XSL file and then push the
# result into the <document> element of the document we're building.
@ -549,10 +564,10 @@ sub process {
unless $opts{n};
}
#
#
# and possibly the corresponding iCal (ics) file
#
if (-f "$opts{i}/$file.ics.xsl") {
if (-f "$opts{i}/$file.ics.xsl") {
my $style_doc = $parser->parse_file("$opts{i}/$file.ics.xsl");
my $stylesheet = $xslt_parser->parse_stylesheet($style_doc);
my $results = $stylesheet->transform($sourcedoc);


+ 68
- 1
tools/xsltsl/tagging.xsl View File

@ -4,7 +4,7 @@
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dt="http://xsltsl.org/date-time">
<xsl:import href="../../tools/xsltsl/date-time.xsl" />
<xsl:import href="date-time.xsl" />
<xsl:import href="feeds.xsl" />
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
@ -128,4 +128,71 @@
</xsl:template>
<!--display dynamic list of tags used in news-->
<xsl:template name="all-tags-news">
<xsl:element name="ul">
<xsl:for-each select="/html/set/news">
<xsl:sort select="@date" order="descending" />
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="@tags" />
<xsl:with-param name="delimiter" select="', '" />
</xsl:call-template>
</xsl:for-each>
</xsl:element>
</xsl:template>
<!--display dynamic list of tags used in events-->
<xsl:template name="all-tags-events">
<xsl:element name="ul">
<xsl:for-each select="/html/set/event">
<xsl:sort select="@start" order="descending" />
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="@tags" />
<xsl:with-param name="delimiter" select="', '" />
</xsl:call-template>
</xsl:for-each>
</xsl:element>
</xsl:template>
<xsl:template name="output-tags">
<xsl:param name="list" />
<xsl:param name="delimiter" />
<xsl:variable name="newlist">
<xsl:choose>
<xsl:when test="contains($list, $delimiter)"><xsl:value-of select="normalize-space($list)" /></xsl:when>
<xsl:otherwise><xsl:value-of select="concat(normalize-space($list), $delimiter)"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="first" select="substring-before($newlist, $delimiter)" />
<xsl:variable name="remaining" select="substring-after($newlist, $delimiter)" />
<xsl:if test="$first != ''">
<xsl:element name="li">
<xsl:value-of select="$first" />
</xsl:element>
</xsl:if>
<xsl:if test="$remaining">
<xsl:call-template name="output-tags">
<xsl:with-param name="list" select="$remaining" />
<xsl:with-param name="delimiter"><xsl:value-of select="$delimiter"/></xsl:with-param>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

+ 17
- 0
tools/xsltsl/translations.xsl View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:template name="gettext">
<xsl:param name="id" />
<xsl:value-of select="/html/set/textset-content/text[@id=$id] |
/html/set/textset-content-backup/text[@id=$id and not(@id=/html/set/textset-content/text/@id)]"/>
</xsl:template>
</xsl:stylesheet>

Loading…
Cancel
Save