Multilanguage - WebHelp

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Multilanguage - WebHelp

Post by Boreas »

Hello,

we use Webhelp and PDF transformation scenarios.
we need to generated our webhelps in 8 different languages. Therefore element tags need to be translated.

At the time, the only way I figured to be able to generate the webhelps in different languages was to hack the dita folder in Frameworks :twisted:
What I did is that I created a dita folder for each language. Within each dita folder I modified the specific files to have the element tags displayed in the proper language.
Then I created a scenario for each language that pointed to the appropriate Dita folder. Works perfectly.
But of course there is a but.
Maintaining 8 dita folders under version control takes a lot of space and takes forever to clone when other users need to use oxygen and Frameworks.(Frameworks is under version control)
Now in another post Radu says
""In Oxygen 12.2 or older there are no translations available for the static texts associated with the search process like Search, Content, Keywords. Oxygen 13 which will be released in September will allow you to set a language parameter to the WebHelp scenarios which will control the language for all static texts.""

Does this mean that wiwth Oxygen 13 I will be able to use only one Frameworks folder to generate my webhelp in all languages?
If not is there a way to do this using only one frameworks folder?

Best regards
Radu
Posts: 9420
Joined: Fri Jul 09, 2004 5:18 pm

Re: Multilanguage - WebHelp

Post by Radu »

Hi,

An Oxygen 13 beta is already available for download. Please see this message on the Oxygen Users List:

http://www.oxygenxml.com/pipermail/oxyg ... 03785.html

So you can try it for yourself.
How the WebHelp translation works in Oxygen 13 (beta and final):

If you duplicate the default DITA Map to Webhelp transformation scenario, in the Parameters tab it contains a new parameter called args.default.language.
If you set that to fr-fr for example then the following XML file:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/xsl/common/strings-fr-fr.xml

will be searched for translations either for the static texts inside the HTML topics like Table or Figure and for the static texts used by the WebHelp plugin like Search and Content.

If you need additional customization the XSLT stylesheet which does the translation for the WebHelp plugin fixed strings is this one:

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/xsl/localization.xsl

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Multilanguage - WebHelp

Post by Boreas »

Hello Radu,

I downloaded Oxygen 13 and tried generating 8 languages from the same Dita folder.

Actually it worked fine. It was easy to change the static labels as they are ALL in the same file. I just needed to set the language attribute on the dita map AND on each file inlcuded in the Ditamap. I also need a transformation scenario for each language as we also need to set the language in the scenario.

I played around with the attributes, setting the ditamap to DE, some files to FR, all with text in English. Looked pretty funny but it shows that we can have more that one language in the same webhelp.

However, the not so good thing was that we had customized our Webhelp( changed link color, images in toc, fonts etc.) Moving to oxygen 13 we had to reimplement manually all our changes....that was no fun.
Perhaps for the next release this could be something to consider, unless there was another way of doing it.

Best Regards

Carole
Radu
Posts: 9420
Joined: Fri Jul 09, 2004 5:18 pm

Re: Multilanguage - WebHelp

Post by Radu »

Hi Carole,

Setting the new parameter args.default.language defined in the list of Parameters for a WebHelp transformation scenario should have been enough to change static texts for all topics to the target language.
But setting the xml:lang on each topic (and the DITA Map) also works of course.

As for the style changes you performed in the TOC part of the frameset, how did you perform them? You probably modified CSS (and image) files from the WebHelp plugin directory, right?

OXYGEN_INSTALL_DIR/frameworks/dita/DITA-OT/plugins/webhelp/resources/assets

What we could try to add would be either to allow for the DITA to WebHelp scenario parameters to specify a custom CSS for the TOC or if a custom CSS is specified by the user using the regular args.css parameter to have this CSS used both in the TOC and the topics displayed in the right part.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Boreas
Posts: 86
Joined: Wed Feb 09, 2011 10:43 pm

Re: Multilanguage - WebHelp

Post by Boreas »

Hello Radu,
yes, if I remove all language attributes in the dita map and topics but set the args.default.language defined in the list of Parameters for the transformation scenario it works, provided the strings-lang1-lang2.xml located in DITA-OT/xsl/common folder is complete. For most languages the following labels were not included.
<!-- various labels (not author controlled) -->
<!-- OXYGEN PATCH START -->
<str name="Content">Content</str>
<str name="Search">Search</str>
<str name="Keywords">Keywords</str>
<str name="Search no results">No results for</str>
<str name="Output generated by">Oxygen etc. </str>
I simply copied the missing labels from the English file and added them to the other files for the other languages I needed. Then the words were displayed in proper language.

We made, in some cases, several changes to the following files
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\commonltr.css
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\webhelp_toc.css
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\webhelp_topic.css
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\jquery.treeview.addon.css
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\jquery.treeview.css
And replaced a few images in Oxygen XML Author 12\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\images

So I guess your suggestion could work provided the commonltr.css
file can be included.
It is not an easy task to customize the layout. I am lucky to have a graphic designer that is HTML and style sheet fluent, but even so it took him a while before figure out what line in which file needed to be modified. This is what I like about the language files it is easy to change static labels.
Best Regards
Carole
Radu
Posts: 9420
Joined: Fri Jul 09, 2004 5:18 pm

Re: Multilanguage - WebHelp

Post by Radu »

Hi Carole,

Thanks for the details.

So for these CSS files:
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\commonltr.css
Oxygen XML Author 13\frameworks\dita\DITA-OT\plugins\webhelp\resources\assets\webhelp_topic.css
it was not necessary to modify the CSS files directly in the WebHelp Plugin directory. You could have created your custom CSS file which overwrote the CSS selectors which were necessary to change and then set the path to it in the DITA transformation scenario Parameters list->args.css parameter. Also the args.copycss could have been set to yes to automatically copy the custom CSS file to the output directory.

As for the CSS files which are used for the TOC part, I think that if we make an improvement so that the custom CSS which can be specified in the scenario parameters is considered to have higher priority in the TOC html file then you could add selectors in the custom CSS file to overwrite the styles used in the TOC.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Radu
Posts: 9420
Joined: Fri Jul 09, 2004 5:18 pm

Re: Multilanguage - WebHelp

Post by Radu »

Hi,

In Oxygen 13.1 which will be released in a couple of weeks we made some modifications in the stylesheets and the custom CSS set by the user in the transformation scenario will also be referenced as the last CSS in the toc.html, thus allowing the custom user CSS to overwrite default CSS selectors.

Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply