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

Post here questions and problems related to editing and publishing DITA content.
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

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

Post 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.
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

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

Post 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
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

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

Post 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.
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

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

Post 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
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

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

Post 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
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

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

Post 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
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

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

Post by lhsihan »

Thanks Julien a lot. It works.
lhsihan
Posts: 35
Joined: Thu Aug 15, 2019 5:31 pm

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

Post 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
julien_lacour
Posts: 495
Joined: Wed Oct 16, 2019 3:47 pm

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

Post 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
Post Reply