Page 1 of 1

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

Posted: Thu Nov 22, 2018 2:17 am
by mdslup
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?

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

Posted: Thu Nov 22, 2018 1:54 pm
by Costin
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

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

Posted: Mon Dec 03, 2018 10:50 pm
by mdslup
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

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

Posted: Tue Dec 04, 2018 1:02 pm
by Dan
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

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

Posted: Thu Dec 20, 2018 3:35 am
by mdslup
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>

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

Posted: Thu Dec 20, 2018 3:55 pm
by Costin
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

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

Posted: Fri Dec 21, 2018 4:28 am
by mdslup
Thank you so much, this is extremely helpful.