Changeset 25250 for other-projects/gti


Ignore:
Timestamp:
2012-03-22T21:50:39+13:00 (12 years ago)
Author:
ak19
Message:
  1. Corrections so that the TMX file generated is accepted by Google Translator Toolkit. 2. Updated to work with changes just made to gs2/bin/script gti.pl: Added code to allow us to get all the up to date strings, instead of just all the strings (but unsorted), or just the strings that require translating/updating. We can create translation memory files (TMX) from all the up to date strings so that can translators using the Google Translator Toolkit can use the strings and string segments as a reference while translating the strings that still require updating/translating. If the TMX file is shared in the GTT, these strings and their segments will also be available to help translators of other application interfaces to use common and consistent terminology.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • other-projects/gti/gti-generate-tmx-xml.xsl

    r25242 r25250  
    33<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:java="http://xml.apache.org/xslt/java">
    44<!--On Translation Memory eXchange open-XML: http://www.opentag.com/tmx.htm and http://www.gala-global.org/oscarStandards/tmx/tmx14b.html
    5 And for character entities: http://www.w3.org/MarkUp/html3/latin1.html-->
     5And for character entities: http://www.w3.org/MarkUp/html3/latin1.html
     6More information: http://xml.coverpages.org/tmxSpec971212.html#O-TMF-->
    67
    78  <xsl:output method="xml" encoding="UTF-8"/>
     
    1011
    1112  <xsl:template match="GTIResponse">
     13    <xsl:text disable-output-escaping="yes">&#10;&lt;!DOCTYPE tmx PUBLIC &quot;-//LISA OSCAR:1998//DTD for Translation Memory eXchange//EN&quot; &quot;tmx14.dtd&quot; &gt;&#10;</xsl:text>
     14
    1215    <tmx version="1.4" xmlns="http://www.lisa.org/tmx14"><xsl:text>&#10;</xsl:text> <!--newline-->
    13     <header creationtool="Greenstone Translator Interface" creationtoolversion="Greenstone2.85"
    14         datatype="PlainText" segtype="sentence"
    15         adminlang="en-us" srclang="EN"
    16         o-tmf="ABCTransMem">
     16    <header
     17       creationtool="Greenstone Translator Interface"
     18       creationtoolversion="Greenstone2.85"
     19       datatype="PlainText"
     20       segtype="sentence"
     21       adminlang="en"
     22       srclang="{$sourcelang}"
     23       o-tmf="GreenstoneTranslationFile"> <!--XLIFF 1.2-->
    1724    </header><xsl:text>&#10;</xsl:text> <!--newline-->
    18     <body><xsl:text>&#10;</xsl:text> <!--newline-->
    19       <xsl:text>&#10;</xsl:text> <!--newline-->
    20       <!--<xsl:apply-templates select="*"/>-->
     25    <body>
     26      <xsl:text>&#10;&#10;</xsl:text> <!--2 newlines-->
    2127      <xsl:apply-templates select="TranslationFile"/>
     28
     29
     30      <xsl:apply-templates select="Chunks"/>
     31
     32      <xsl:apply-templates select="UptodateChunks"/>
     33
    2234      <!-- control the order: first all the strings needing to be updated, then all those that need translating-->
    2335      <xsl:apply-templates select="ChunksRequiringUpdating"/>
     
    3951  </xsl:template>
    4052
     53  <xsl:template match="UptodateChunks">
     54    <xsl:text>&#10;</xsl:text>
     55    <note><xsl:text xml:lang="en">Uptodate chunks</xsl:text></note><xsl:text>&#10;</xsl:text>
     56    <xsl:apply-templates select="Chunk">
     57      <xsl:sort select="@key"/>
     58    </xsl:apply-templates>
     59  </xsl:template>
     60
    4161  <xsl:template match="ChunksRequiringTranslation">
    4262    <xsl:text>&#10;</xsl:text> <!--newline-->
     
    4868
    4969  <xsl:template match="ChunksRequiringUpdating">
    50     <xsl:text>&#10;</xsl:text> <!--newline-->
     70    <xsl:text>&#10;</xsl:text> <!--newline-->     
    5171    <note><xsl:text xml:lang="en">Chunks requiring updating</xsl:text></note><xsl:text>&#10;</xsl:text> <!--newline-->
    5272    <xsl:apply-templates select="Chunk">
     
    5575  </xsl:template>
    5676
     77  <xsl:template match="Chunks">
     78    <xsl:text>&#10;</xsl:text>
     79    <note><xsl:text xml:lang="en">All chunks</xsl:text></note><xsl:text>&#10;</xsl:text>
     80    <xsl:apply-templates select="Chunk">
     81      <xsl:sort select="@key"/>
     82    </xsl:apply-templates>
     83  </xsl:template>
    5784
    5885  <xsl:template match="Chunk">
Note: See TracChangeset for help on using the changeset viewer.