Changeset 25287

03/23/12 21:09:57 (9 years ago)
  1. Added two new XSLT files: both generate the spreadsheet .txt files necessary from the chunks of strings that still require translation work. 2. Added extensive comments into each file on how to use the 4 recently added XSLT files.
2 added
2 edited


  • other-projects/gti/gti-generate-tmx-xml.xsl

    r25286 r25287  
    66More information:>
     9    A Translation Memory eXchange (TMX) file is an openXML file that contains translated strings that can serve as
     10    a reference library for future translation work.
     12    When users want to take all the up to date translated strings in Greenstone and use it in the Google Translator Kit
     13    (GTT) as the basis to continue their translation work on the remaining strings (yet to be translated), this XSLT file
     14    can be used to generate a TMX from the already-translated strings. The user can then upload this into the GTT.
     15    Further translation work that the translator does in the GTT will be added to its growing internal TMX file which
     16    appears to be inaccessible.
     18    The process of generating a TMX file of Greenstone's up to date strings for a language is as follows:
     20       1. Generate an xml file containing all the up to date chunks (those strings that don't require translation work).
     21    GS2/bin/java>perl -S get-uptodate-chunks mi coredm > ../../macros/maori/uptodatechunks_core.xml
     23       2. Generate a TMX file from that XML file as follows:
     24       GS2/bin/java>java -cp /research/ak19/gs2-svn/bin/java/ApplyXSLT.jar org.nzdl.gsdl.ApplyXSLT -x ../../macros/maori/uptodatechunks_core.xml -t ../script/gti-generate-tmx-xml.xsl -l mi > ../../maori/uptodatecore-mi.tmx
     26       GS2/bin/java>less ../../maori/uptodatecore-mi.tmx
     28       3. Send this to the user and they can upload it into GTT.
     31       (The DOCTYPE has only been commented out below in order to let a further XSLT process the output of this file into a spreadsheet .txt file.
     32        Since a third XSLT file exists which operates on another XML file to obtain the spreadsheet .txt file, the DOCTYPE can be reinstated if required.)
     33    -->
    836  <xsl:output method="xml" encoding="UTF-8"/>
    937  <xsl:param name="sourcelang"/>
    1240  <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>
     41    <!-- if applying this XSLT file results in an error mentioning ".../tmx14.dtd (No such file or directory)"
     42     then comment out the DOCTYPE declaration below -->
     43    <!--<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>-->
    1545    <tmx version="1.4" xmlns=""><xsl:text>&#10;</xsl:text> <!--newline-->
    2151       adminlang="en"
    2252       srclang="{$sourcelang}"
    23        o-tmf="GreenstoneTranslationFile"> <!--XLIFF 1.2-->
     53       o-tmf="GreenstoneTranslationFile">
    2454    </header><xsl:text>&#10;</xsl:text> <!--newline-->
    2555    <body>
  • other-projects/gti/gti-tmx-to-txt.xsl

    r25242 r25287  
    11<?xml version="1.0" encoding="UTF-8"?>
    22<xsl:stylesheet version="1.0" xmlns:xsl="" xmlns:java="" xmlns:tmx="">
     3  <!-- For character entities: -->
    34  <!-- The necessity for using xml namespaces all over and matching on namespaced element names -->
     7       This file (obsolete) is used to produce the intermediate text file required from a translated TMX file sent in by the user. This intermediate text file, consisting of
     8       2 columns of data, is then fed into the existing pipeline of processing translated spreadsheets, so that translation updates can be committed back into the GS repository.
     10       This assumes that the file returned by the translator is a TMX file also. In practice, this is unlikely to be the case when using GTT, since it does not allow downloading
     11       of GTT files. That is why this XSLT file is obsolete.
     12       However, it's use on an input TMX file is explained below.
     15       1. Generate an xml file containing the chunks requiring work.
     16       GS2/bin/script> perl -S get-first-n-chunks-requiring-work mi coredm 1000 > ../../macros/maori/mi-core.xml
     18       2. Generate a TMX file from that XML file as follows:
     19       GS2/bin/script> java -cp /research/ak19/gs2-svn/bin/java/ApplyXSLT.jar org.nzdl.gsdl.ApplyXSLT -x ../../macros/maori/mi-core.xml -t ../script/gti-generate-tmx-xml.xsl -l mi > ../../maori/core-mi.tmx
     21       3. Once the user has finished translating, and ONLY ASSUMING the file they return is a TMX file again, apply this XSLT to obtain the .txt required:
     22       GS2/bin/java>java -cp /research/ak19/gs2-svn/bin/java/ApplyXSLT.jar org.nzdl.gsdl.ApplyXSLT -x ../../maori/core-mi.tmx -t ../script/gti-tmx-to-txt.xsl > ../../maori/core-mi.txt
     25       4. Try processing this UTF-16 text file as before, as explained on the wiki:
     27       > perl -S language.txt > language-submission.xml
     28       > cat language-submission.xml | perl -S submit-translations language-code module-name username
     29       (There are extra steps when GLI help files are translated, see the internal.greenstone wiki page again).
     31    -->
    533  <xsl:output method="text" encoding="UTF-16"/> <!-- When we save as txt from Excel, we choose UTF-16 too -->
Note: See TracChangeset for help on using the changeset viewer.