How to generate locale specific output?

Post here questions and problems related to editing and publishing DITA content.
ejsumi
Posts: 11
Joined: Wed Dec 18, 2019 9:20 am

How to generate locale specific output?

Post by ejsumi »

Hi Team,

We have a requirement where we have to generate output for multiple locale in English like US English, UK English.
For example, customize in US English and customise in UK English
How can we generate locale-specific output in Oxygen 21?

Thanks,
Sumi
ionela
Posts: 402
Joined: Mon Dec 05, 2011 6:08 pm

Re: How to generate locale specific output?

Post by ionela »

Hi,

Just to double check, are you trying to customize the static labels? If yes, you can follow this procedure from our user manual:
How to Localize the Interface of WebHelp Responsive Output

Regards,
Ionela
Ionela Istodor
oXygen XML Editor and Author Support
ejsumi
Posts: 11
Joined: Wed Dec 18, 2019 9:20 am

Re: How to generate locale specific output?

Post by ejsumi »

Hi Ionela,

No, we were looking if there is a way to change the text of the content based on the locale.
For example, for US customers and UK customers, the words would differ on 'iz' or 'is' like customize/customise, authorization/authorisation, etc or in words like cancelled/canceled.

Adding DITAVAL is one method.
But is there another option, since we have got a lot of topics, that have to be delivered for the UK and US locale. Adding DITAVAL to every such word topic by topic would be time-consuming. Is there another option?
alin
Site Admin
Posts: 268
Joined: Thu Dec 24, 2009 11:21 am

Re: How to generate locale specific output?

Post by alin »

Hello,

You can automatically add DITAVAL profiling attributes for your use case using a custom XML Refactoring Operation (XRO): For example you can create a custom XRO that, based on an input list of words, can replace each word occurrence in content with a fragment like the one below:

Code: Select all

<ph audience="en-us">authorize</ph><ph audience="en-uk">authorise</ph>
The file containing the list of words that have different forms for different locales can have the following structure:

Code: Select all

<words>
    <word>
        <locale value="en-us">customize</locale>
        <locale value="en-uk">customise</locale>
    </word>
    <word>
        <locale value="en-us">authorize</locale>
        <locale value="en-uk">authorise</locale>
    </word>
    <word>
        <locale value="en-us">canceled</locale>
        <locale value="en-uk">cancelled</locale>
    </word>
</words>
You can apply the XRO on a variety of scopes. One of this scopes can be the Current DITA Map hierarchy. (see the Scopes section from https://www.oxygenxml.com/doc/versions/ ... ments.html)
After executing the XRO you can see a preview with all the modifications that will be applied on content. For example:
Image
I have created a sample XRO that tries to achieve what I have described above. You can download it from here: http://www.oxygenxml.com/userFiles/xml-refactoring.zip
The archive contains the following resources:
  • The XRO descriptor file
  • The XSLT script that is executed on each input XML file when applying the XRO
  • A sample XML file that is used by the XRO to determine which words should be replaced in the content with their locale specific forms.
    Note: You should edit this file and add more words respecting the pattern in the file.
In order to load the XRO in Oxygen please follow these instructions: https://www.oxygenxml.com/doc/versions/ ... tions.html
You can reapply the XRO multiple times on a file because once a word is profiled it is ignored on the next XRO execution.

Regards,
Alin
Alin Balasa
Software Developer
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply