Static Labels

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
Boreas
Posts: 82

Static Labels

Wed Nov 19, 2014 11:09 pm

Hello,
I am trying to change an English static label (Context in a task) I was on the impression it was in OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg/common/vars
but when I change the label in the en.xml file, it does not appear in my PDF output. I did set the args.gen.task.lbl parameter to YES, but with no result.
So I am guessing that I am not using the proper en.xml file?

I don't know if it is related, but the language attribute is not picked-up. So even if my topic is set to fr_FR, the labels are in English.

I use Oxygen version 16.

Regardsé
sorin_ristache
Posts: 4144

Re: Static Labels

Thu Nov 20, 2014 4:36 pm

Boreas wrote:I am trying to change an English static label (Context in a task) I was on the impression it was in OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/org.dita.pdf2/cfg/common/vars
but when I change the label in the en.xml file, it does not appear in my PDF output. I did set the args.gen.task.lbl parameter to YES, but with no result.
So I am guessing that I am not using the proper en.xml file?


The directory is correct: OXYGEN_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\cfg\common\vars. The file depends on the value of the xml:lang attribute on the root element of the DITA XML topic file (topic, task, concept, etc.): the file en.xml for English (the default language, if the xml:lang attribute is missing), the file fr.xml for French, etc.

To change the task context label you need to change the element <variable id="Task Context"> in the file for your language: en.xml, fr.xml, etc.

Boreas wrote:I don't know if it is related, but the language attribute is not picked-up. So even if my topic is set to fr_FR, the labels are in English.

I use Oxygen version 16.


I did the following test: I added the attribute xml:lang="fr" to the <task> element in a DITA task file and I changed the content of the <variable id="Task Context"> element in the fr.xml file. In the PDF output the context title label for that task was changed according to my modification in the fr.xml file.

If the change in the fr.xml does not work for you please send us a set of sample files for reproducing the problem: a sample DITA map and the topic files included in the map, the modified files in the OXYGEN_DIR\frameworks\dita\DITA-OT\plugins\org.dita.pdf2 directory.
Regards,
Sorin

<oXygen/> XML Editor Support
Boreas
Posts: 82

Re: Static Labels

Thu Nov 20, 2014 5:03 pm

Hello,
apparently I changed the proper variable, but it is still not working. I will send you my samples.

<!--Labels for task sections-->
<variable id="Task Prereq">Before you begin</variable>
<variable id="Task Context">Information</variable>
<variable id="Task Steps">Procedure</variable>
<variable id="#steps-unordered-label"><variable id="Task Steps"/></variable>
<variable id="Task Result">Results</variable>
<variable id="Task Example">Example</variable>
<variable id="Task Postreq">What to do next</variable>
sorin_ristache
Posts: 4144

Re: Static Labels

Fri Nov 21, 2014 6:22 pm

Thank you for the files. I just replied you by email about the correct location of the xml:lang attribute and the localization file (en.xml or fr.xml) that you need to modify depending on the value of the xml:lang attribute on the root element in the DITA XML topic file.
Regards,
Sorin

<oXygen/> XML Editor Support
Boreas
Posts: 82

Re: Static Labels

Wed Nov 26, 2014 4:13 pm

hello,

found the reason why the new label was not being displayed. :D If the language attribute is not set on each file the new labels are not picked up. In one ditamap I set the language attribute on half of the files. The PDF displayed the new label only on the files that had the language attribute. Weird. Setting the language attribute on the ditamap only, does not work.
When I work in English only I never set the language attribute, perhaps this is a wrong way to work?

Regards
sorin_ristache
Posts: 4144

Re: Static Labels

Wed Nov 26, 2014 4:41 pm

If the xml:lang attribute is not set in an XML topic file then the default language will be applied for the labels in that topic, which is English. That means:

  • it is not wrong to work without setting the language attribute if all topics have English content,
  • if you changed some labels in the en.xml file and you don't set the xml:lang in a topic file then the changed labels should be used in the PDF output in the content of that topic.
Regards,
Sorin

<oXygen/> XML Editor Support
GKlimeck
Posts: 14

Re: Static Labels

Tue May 09, 2017 12:25 am

I have a problem related to the discussion in this thread. Currently using Oxygen 18.
1. In my pdf (resulting from transformation of xml), the Results: section title is "task_result".
The other section titles are correct, as set in the en.xml file below.

2. If I change the language to french in <task id="task_vcm_hwy_dz" xml:lang="en">
I get french titles, except for the Results: section which is still "task_result". So... this may be a bug in Oxygen?

On the pdf transformation scenario, I have set:
args.gen.task.lbl to "YES" to generate headings for sections within the task topics.

The file:
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\cfg\common\vars/en.xml
has the following lines:
<!--Labels for task sections-->
<variable id="Task Prereq">What to do next</variable>
<variable id="Task Context">About this task</variable>
<variable id="Task Steps">Procedure</variable>
<variable id="#steps-unordered-label"><variable id="Task Steps"/></variable>
<variable id="Task Result">Results</variable>
<variable id="Task Example">Example</variable>
<variable id="Task Postreq">What to do next</variable>

3. Even if I edit the en.xml text above, the changes do not appear on my pdf. For example, if I change "What to do next" to "What next" my pdf still has the former.
Therefore, it appears that the en.xml file above is not where section titles are set.

Where do I set the section titles?
Thank you for your help,
Ginny
Costin
Posts: 275

Re: Static Labels

Tue May 09, 2017 5:59 pm

Hi GKlimeck,

Please note that there are 2 different en.xml files corresponding to the 2 different DITA Open Toolkit versions that oXygen XML comes bundled with.
For the changes to be reflected in the PDF output, it is important that you modify the right file, the one corresponding to the DITA-OT that oXygen currently uses for your PDF transformation.
In case you are using the default DITA Map > PDF transformation scenario bundled in oXygen, as is (without editing it), you should make sure that you modify the "en.xml" file in the right DITA OT.

Like I mentioned above, oXygen XML v18 comes bundled with two different DITA OTs, specifically: DITA OT 1.8 and DITA OT 2.x.
If you are using DITA OT 1.8 in oXygen (you can see what is the DITA OT currently used by oXygen, going into the oXygen menu Options > Preferences > DITA, under the DITA OT section), you should modify the file from Oxygen18_install_dir\frameworks\dita\DITA-OT\plugins\org.dita.pdf2\cfg\common\vars/en.xml
Otherwise, if you are using DITA 2.x in the preferences page, then the right "en.xml" file you need to modify is the one from Oxygen18_install_dir\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\common\vars.

If you haven't tinkered with the DITA OT options, the default DITA OT used by oXygen should be the DITA OT 2.x.
Additionally, you can find the detailed instructions to modify the generated text labels for various languages in the DITA OT guide, at:
http://www.dita-ot.org/2.4/dev_ref/plug ... dtext.html

I hope this helps!

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
GKlimeck
Posts: 14

Re: Static Labels

Tue May 09, 2017 9:52 pm

Hi Costin,
I am using DITA-OT 2.x
I edited the file you recommended - here is the path:
C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\cfg\common\vars\en.xml

Here is the edit:
<!--Labels for task sections, now reused from common-->
<variable id="Task Prereq"></variable>
<variable id="Task Context"></variable>
<variable id="Task Steps"></variable>
<variable id="#steps-unordered-label"></variable>
<variable id="Task Result">Task Result</variable>
<variable id="Task Example"></variable>
<variable id="Task Postreq"></variable>

Note that there were no section titles before, but I added Task Result anyway. What does the comment mean: now reused from common? Where is common?

My xml still transforms to pdf section subheading "task_result". I do not seem to have editted the right file.

To check, I edited the following lines in the same file:
<!-- Template for generated page number of a reference
in printed manual. -->
<!-- OLD: <variable id="On the page"> on page <param ref-name="pagenum"/></variable> -->
<variable id="On the page"></variable>

This did have an effect on my pdf - I no longer see "on page #" after cross references within the same file.
Your help finding the right place to edit section titles would be much appreciated.
Ginny
GKlimeck
Posts: 14

Re: Static Labels

Tue May 09, 2017 10:45 pm

Hi Costin,
Maybe the key to this problem is the fact that the pdf displays task_result

In the file C:\Program Files\Oxygen XML Editor 18\frameworks\dita\DITA-OT2.x\xsl\common\strings-en-us.xml
the string name is task_results <-- with an s on the end.

But for some reason the pdf transformation is looking for a string named task_result, which doesn't exist(?).
Ginny
Costin
Posts: 275

Re: Static Labels

Wed May 10, 2017 5:57 pm

Hi again,

Further investigation of this issue pointed us to a known bug in the DITA Open Toolkit 2.2.3, which we bundled in oXygen XML version 18.0 when that older version of oXygen was released.
You can find more information about the bug I stumbled upon at:
https://github.com/dita-ot/dita-ot/issues/2203

As you already figured out, it seems that in the DITA OT internationalization, there is indeed a "task_result" string in the task-elements.xsl file from Oxygen XML install dir\frameworks\dita\DITA-OT2.x\plugins\org.dita.pdf2\xsl\fo, instead of "task_results", as it should be and as it is declared in the Oxygen XML install dir\frameworks\dita\DITA-OT2.x\xsl\common\strings-en-us.xml file

Even if the first thought might be to modify either the "task-elements.xsl" or the "strings-en-us.xml" file, it is not recommended to modify the DITA OT files. Instead, you could create a plugin and include a modified copy of the files in it, as per the instructions at the link I provided in my previous post.

As a quick solution however, because your v18 license key is compatible with all v18.x minor versions of oXygen, you could install and use oXygen XML v18.1 (the latest maintenance build of v18.1 is available in the
Software Archive) instead of the older version 18.0. That's because the bug in discussion was fixed in a later version of DITA OT 2 (2.2.4) and oXygen XML v18.1 came bundled with the version 2.3.3, so the issue should not occur anymore using the newer version 18.1 of oXygen XML Editor.

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support
GKlimeck
Posts: 14

Re: Static Labels

Thu May 11, 2017 3:38 pm

Thanks Costin. Upgrade 18.1 solved the problem. What is the cost if I upgrade to 19.0, given that I already have 18? I don't find that information on the Oxygen website. Just the price to buy new.
Thank you,
Ginny
Costin
Posts: 275

Re: Static Labels

Thu May 11, 2017 4:03 pm

Hello again,

I have just sent you an email with the price quotes to upgrade your license to the latest version available.
Please address all further sales related questions or inquiries on our official sales support email: sales AT oxygenxml DOT com
Also, technical questions can be addressed to the technical support email address: support AT oxygenxml DOT com

Regards,
Costin
Costin Sandoi
oXygen XML Editor and Author Support

Return to “Common Problems”

Who is online

Users browsing this forum: No registered users and 1 guest