CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

mdslup
Posts: 126
Joined: Tue Mar 06, 2018 1:34 am

CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by mdslup » Thu Nov 22, 2018 2:17 am

CSS-Based PDF,

Where are the localized strings for things like "Note", "warning", "caution", etc stored? And do I use the default.lang transform parameter to control which set of strings get used?

Costin
Posts: 642
Joined: Mon Dec 05, 2011 6:04 pm

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by Costin » Thu Nov 22, 2018 1:54 pm

Hello,

Yes, depending on the language you set through the "xml:lang parameter", the DITA-OT uses the set of labels appropriate to that specific language.
Going further, you could edit the text used for specific labels, through CSS customization.
More specific, you could use your own customization .css file which should override the default translations.

Detailed information, about the default .css files and how to customize the labels for various elements for both CSS-based PDF transformation scenarios, available in the Localization section from the DITA-OT CSS Publishing to PDF Plugin User-Guide.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

mdslup
Posts: 126
Joined: Tue Mar 06, 2018 1:34 am

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by mdslup » Mon Dec 03, 2018 10:50 pm

When I was generating PDFs using the old XSLT generation (ie, out-of-the-box Oxygen PDF transformation), I was able to control these notes, warnings, and cautions using the default.language parameter.

But that doesn't seem to work anymore. Likewise, when I set the "xml:lang" parameter, I still can't seem to control the strings. Any other suggestions, or any idea on what I might have missed? I expect the strings to be controlled from the files in this directory:


.....Oxygen XML Editor 20.1\frameworks\dita\DITA-OT2.x\xsl\common

Dan
Posts: 433
Joined: Mon Feb 03, 2003 10:56 am

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by Dan » Tue Dec 04, 2018 1:02 pm

Hello,
Can you give us more details?
- the language you are using
- what scenario are you using, the one named "DITA Map PDF - based on HTML5 & CSS", or "DITA Map PDF - based on DITA & CSS (WYSIWYG) "?
The first one uses the i18n support provided by DITA-OT, and has a good coverage for many languages. The other one has a CSS that adds the labels, and a very limited number of supported languages.

Please read more here:
https://www.oxygenxml.com/doc/versions/ ... ation.html

Many regards,
Dan

mdslup
Posts: 126
Joined: Tue Mar 06, 2018 1:34 am

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by mdslup » Thu Dec 20, 2018 3:35 am

I duplicated the "DITA Map PDF - based on HTML5 & CSS" scenario. I used this scenario on a map with 1 very simple task file (the XML is at the bottom of this message).

Looking at the parameters of my scenario, I only see one that is related to language: default.language. I tried setting this to "de" and "de-de", but still the "Warning", "Caution", and "Note" texts were in English. Next, I tried adding a parameter: xml:lang. Again, I set this to both "de" and "de-de" but the text was in English.

Can you help me from here, or can I provide additional information?








<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE task PUBLIC "-//OASIS//DTD DITA Task//EN" "task.dtd">
<task id="task_d14_mxj_2gb">
<title>PDF Language Test</title>
<taskbody>
<steps>
<step>
<cmd>Perform step 1.</cmd>
<info>
<note>This is a note.</note>
</info>
</step>
<step>
<cmd>Perform step 2.</cmd>
<info>
<note
type="caution">This is a caution.</note>
</info>
</step>
<step>
<cmd>Perform step 3.</cmd>
<info>
<note
type="warning">This is a warning.</note>
</info>
</step>
</steps>
</taskbody>
</task>

Costin
Posts: 642
Joined: Mon Dec 05, 2011 6:04 pm

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by Costin » Thu Dec 20, 2018 3:55 pm

Hello,

As advised in the "Localization for the PDF - Based on DITA and CSS Transformation Type" / "How to Enable German Localization" subsection from the User-Guide, to use German language, you should just set the xml:lang="de-de" on the root of the main DITA Map.

If you do not need all the topics from the DITA Map to have German localization, but only a specific task, you should open that specific task in editor and set the xml:lang attribute on the root of that task.

Best Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

mdslup
Posts: 126
Joined: Tue Mar 06, 2018 1:34 am

Re: CSS-Based PDF, change language of "Note", "Warning", "Caution" etc

Post by mdslup » Fri Dec 21, 2018 4:28 am

Thank you so much, this is extremely helpful.

Post Reply