xsltprocを使って翻訳メモリのtmxファイルをcsvに変換するXSLTファイル
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> | |
<xsl:output method="text" encoding="utf-8" /> | |
<xsl:template match="/"> | |
<xsl:text>"en-US"	"ja"</xsl:text> | |
<xsl:text>
</xsl:text> | |
<xsl:for-each select="tmx/body/tu"> | |
<xsl:text>"</xsl:text> | |
<xsl:value-of select="tuv[@lang='en-US']/seg"/> | |
<xsl:text>"	"</xsl:text> | |
<xsl:value-of select="tuv[@lang='ja']/seg"/> | |
<xsl:text>"
</xsl:text> | |
</xsl:for-each> | |
</xsl:template> | |
</xsl:stylesheet> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
tmx2tsv.xsl (Convert TMX to TSV using xsltproc)
Use xsltproc to convert a translation memory TMX file to a TSV file.
Usage
$ xsltproc tmx2tsv.xsl file.tmx > file.tsv