Page 1 of 1

words in different languages

Posted: Thu Feb 12, 2015 10:32 am
by Le Basque
Hi,

In dita i use <note with attribute type.
I used chinese with file vars / zh_CN.xml (contains traduct for mention important, note, ...)
in the file that contains the note tag i indicate xml:lang="zh_CN"
But in publication the word is not translated ?

Thank you for your response

Re: words in different languages

Posted: Thu Feb 12, 2015 11:11 am
by Radu
Hi,

I tested and setting the xml:lang="zh-CN" attribute on the note seems to work for me both for the PDF and for the WebHelp outputs using the DITA OT bundled with Oxygen 16.1. The static text "Note" was properly translated to chinese.

Regards,
Radu

Re: words in different languages

Posted: Fri Feb 13, 2015 10:21 am
by Le Basque
Thank you for your response, I had indicated zh_CN instead of zh-CN

I have an other question, where i found call to file en.xml in xsl ?

Thank you

Re: words in different languages

Posted: Fri Feb 13, 2015 10:27 am
by Radu
Hi,

If you want this for the PDF output there is an XSLT stylesheet:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/xsl/common/vars.xsl

which contains a template called insertVariable. That template gets called from many XSLT templates with the key to be translated and it maps the key to one of the translation XML files taking the current language into account.

Regards,
Radu

Re: words in different languages

Posted: Fri Feb 13, 2015 11:02 am
by Le Basque
I am precisely how the en.xml file (for example) is called from a stylesheet ?

Thank you

Re: words in different languages

Posted: Fri Feb 13, 2015 11:39 am
by Radu
Hi,

Let's take of the case of the DITA <note>.
In the XSLT:

OXYGEN_INSTALL_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\xsl\fo\commons.xsl

there is an XSLT template:

Code: Select all


<xsl:template match="*" mode="placeNoteContent">
.....
which at some point in order to output the static translate "Note:" content calls:

Code: Select all

 <xsl:call-template name="insertVariable">
<xsl:with-param name="theVariableID" select="'Note'"/>
</xsl:call-template>
That "insertVariable" template I previously mentioned calls another template called findVariable which uses the XSLT document function to read various XML configuration files. You can add xsl:messages in the code to better see how it works.

Regards,
Radu