Page 1 of 1

How to change the Content and Chapter to Chinese character in generated PDF

Posted: Wed Oct 23, 2019 12:49 pm
by lhsihan
Hi experts,
We generated one PDF using the transformation scenario DITA Map PDF - based on HTML5 & CSS but the Contents and Chapter in the PDF are still English.

How can we change the Contents, Chapter1,Chapter2 and etc to Chinese words.

Thanks a lot.

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Wed Oct 23, 2019 5:12 pm
by julien_lacour
Hello,

For now, if you want the Content, Chapter 1, etc... texts to be translated in chinese you have to set your ditamap @xml:lang attribute to "zh-cn" (the value should be all in lower case).

Regards,
Julien

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Mon Oct 28, 2019 6:56 am
by lhsihan
Hi Julien,
Thanks a lot. I have followed your guide, but it is not working. I have tried set the "xml:lang" to "zh", "zh-cn", "zh-CN", neither of them works.

Code: Select all

<map xml:lang="zh-cn">
Could you please help give me another hand on this?

Thanks a lot.

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Mon Oct 28, 2019 11:01 am
by julien_lacour
Hello,

Can you please verify if the attribute xml:lang is not set inside one of your topics.
If this attribute is set, it changes the display in the output PDF.
If this not resolve your problem, can you please send us a small sample of your map?

Regards,
Julien

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Tue Oct 29, 2019 5:16 am
by lhsihan
Hi Julien,
We need to set the xml:lang="zh" in every our topic so that to make sure the generated text will be Chinese.

Our map is like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map xml:lang="zh">
    <title xml:lang="zh">CBS产品文档中文</title>
    <topichead navtitle="快速入门" xml:lang="zh-CN">
        <topicref href="quickstart_0001.dita"/>
        <topicref href="quickstart_0002.dita"/>
        <topicref href="quickstart_0003.dita"/>
        <topicref href="quickstart_0004.dita"/>
        <topicref href="troubleshooting.dita"/>
    </topichead>
</map>
And the Contents part in PDF is as below:

Code: Select all

Contents
Chapter 1. 快速入门..............................................................................................................1

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Tue Oct 29, 2019 12:43 pm
by julien_lacour
Hello,
As I explain in my first answer, the ditamap xml:lang attribute must be set to "zh-cn".
In your case the result should be like this:

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE map PUBLIC "-//OASIS//DTD DITA Map//EN" "map.dtd">
<map xml:lang="zh-cn">
    <title xml:lang="zh">CBS产品文档中文</title>
    <topichead navtitle="快速入门" xml:lang="zh-CN">
        <topicref href="quickstart_0001.dita"/>
        <topicref href="quickstart_0002.dita"/>
        <topicref href="quickstart_0003.dita"/>
        <topicref href="quickstart_0004.dita"/>
        <topicref href="troubleshooting.dita"/>
    </topichead>
</map>
After that, the Contents, Chapters, etc... will appear in chinese.

Regards,
Julien

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Wed Oct 30, 2019 4:26 am
by lhsihan
Thanks Julien a lot. It works.

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Wed Oct 30, 2019 9:51 am
by lhsihan
Hi Julien,
One more question is that why the number in content is in wrong postion?
Such like:

Code: Select all

第 章1. 快速入门.....................................................................................................................1
It should be:

Code: Select all

第1章. 快速入门.....................................................................................................................1
How can we figure this out? Thanks a lot

Re: How to change the Content and Chapter to Chinese character in generated PDF

Posted: Wed Oct 30, 2019 3:24 pm
by julien_lacour
Hello,

We have corrected this behavior in the current release of DITA-OT CSS Publishing to PDF Plugin.
If you want, you can contact us at support@oxygenxml.com and we can provide you a SNAPSHOT of the new version for testing.

Regards,
Julien