words in different languages

Post here questions and problems related to editing and publishing DITA content.
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

words in different languages

Post 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
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: words in different languages

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Re: words in different languages

Post 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
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: words in different languages

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Le Basque
Posts: 147
Joined: Sat Oct 19, 2013 8:21 am

Re: words in different languages

Post by Le Basque »

I am precisely how the en.xml file (for example) is called from a stylesheet ?

Thank you
Radu
Posts: 9049
Joined: Fri Jul 09, 2004 5:18 pm

Re: words in different languages

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply