Task labels in HTML5 output

kwriter
Posts: 15

Task labels in HTML5 output

Fri May 26, 2017 10:41 pm

Hello,

I'd like to change the "Before you begin" task label to "Prerequisites" in HTML5 output from DITA. I am using Oxygen 19, DITA-OT 2.4.4 that was installed with Oxygen. Where does this string get pulled from for HTML5 output?

I noticed a few of the plugins have localization folders that seem to contain the task label strings, but I didn't see one for HTML5.

Thanks.

K
ionela
Posts: 218

Re: Task labels in HTML5 output

Mon May 29, 2017 4:56 pm

Hi,

To modify the task label from 'Before you begin' to 'Prerequisites' in the HTML5 output from a DITA source you should follow the
Modifying or adding generated text > modifying existing strings procedure from DITA-OT documentation:
http://www.dita-ot.org/2.4/dev_ref/plugin-addgeneratedtext.html

In short, to achieve this you need to create a DITA-OT plugin in [OXYGEN_INSTALL_DIR]/frameworks/dita/DITA-OT2.x/plugins.

  1. So, you should first create a folder such as:
    [OXYGEN_INSTALL_DIR]/frameworks/dita/DITA-OT2.x/plugins/com.oxygenxml.customstrings
  2. The 'Before you begin' label is found in [OXYGEN_INSTALL_DIT]/dita/DITA-OT2.x/xsl/common/strings-en-us.xml.
    You can start from this file and create a custom-string-en-us.xml with a code similar with:

    Code: Select all

    <?xml version="1.0" encoding="utf-8"?>
    <strings xml:lang="en-us">   
    <str name="task_prereq"Before you begin MODIFIED</str>
    </strings>

  3. Then, you should create an XML file my-strings.xml that refers the custom file previously created for that specific language (en-us in this case) :

    Code: Select all

    <?xml version="1.0" encoding="utf-8"?>
    <langlist>
      <lang xml:lang="en-us"  filename="custom-strings-en-us.xml"/>
    </langlist>
  4. After that, in the plugin directory you need to create a plugin.xml that refers the my-strings.xml file previously created:

    Code: Select all

    <?xml version="1.0" encoding="UTF-8"?>
    <plugin id="com.oxygenxml.customstrings">
        <feature extension="dita.xsl.strings" file="my-strings.xml"/>
    </plugin>

    Make sure that all these 3 files: custom-strings-en-us.xml, my-strings.xml and plugin.xml are saved in your DITA-OT plugin directory (e.g. com.oxygenxml.customstrings).
  5. Run the predefined transformation scenario called Run DITA OT Integrator by executing it from the Apply Transformation Scenario(s) dialog box. Note that you need to run oXygen with administrative rights when you run the Integrator.
    The DITA OT Integrator should be run when you have finished the customizations and this way the plugin is added to your DITA-OT deployment.
  6. Edit the DITA Map HTML5 transformation scenario and set the parameters args.gen.task.lbl to YES and the default.language to the language defined in the my-strings.xml (en-us).
  7. Run the DITA Map HTML5 transformation scenario to produce the HTML5 output.
I hope this helps.

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
kwriter
Posts: 15

Re: Task labels in HTML5 output

Tue May 30, 2017 9:26 pm

That worked perfectly. Thanks so much for your help!

Return to “DITA (Editing and Publishing DITA Content)”

Who is online

Users browsing this forum: No registered users and 0 guests