I have an XSLT stylesheet that transforms the XML data into XSL-FO (which is then rendered as a PDF using Apache FOP).
Now, I would need to localize the output to a couple of different languages. For instance, column headers for the tables produced by the XSLT need to be localized. Here's a simplified snippet of the XSLT producing a table header with column captions "Date", "Name" and "Something" :
...
<fo:table>
<fo:table-header>
<fo:table-row>
<fo:table-cell>
<fo:block>Date</fo:block>
</fo:table-cell>
<fo:table-cell>
<fo:block>Name</fo:block>
</fo:table-cell>
<fo:table-cell>
</fo:block>Something</fo:block>
</fo:table-cell>
</fo:table-row>
</fo:table-header>
</fo:table-body>
<xsl:apply-templates select="item"/>
</fo:table-body>
</fo:table>
...
We are already using TMX files for internationalization in other parts of the system, so that seems like a natural way to go about it. Here's a simplified example of a TMX file with a couple of strings in two languages:
<tmx version="1.4b">
<body>
<tu tuid="DATE">
<tuv xml:lang="en"><seg>Date</seg></tuv>
<tuv xml:lang="sv"><seg>Datum</seg></tuv>
</tu>
<tu tuid="NAME">
<tuv xml:lang="en"><seg>Name</seg></tuv>
<tuv xml:lang="sv"><seg>Namn</seg></tuv>
</tu>
</body>
</tmx>
So basically I'd like to replace the hard-coded column headers in the XSLT with references to the strings in the TMX file (using tuid attributes), so that the same XSLT could produce output in different languages.
But I can't seem to find any resources on how to use TMX files with XSLT. Examples or pointers to some good tutorials would be greatly appreciated.