Page 1 of 1

localizing "With Frames" in webhelp_topic.js

Posted: Thu Mar 19, 2015 8:34 pm
by rdelong
I thought that the reason the WebHelp plugin provides the variables files (.\com.oxygenxml.webhelp\oxygen-webhelp\resources\localization\*.xml) is to provide localized words and phrases for translated output. However, the webhelp_topic.js contains the English phrase "With Frames" (line 60) and shows up as English in my translated output.

Can you update this JavaScript file so that it uses the localized string named "oldFrames"?

Re: localizing "With Frames" in webhelp_topic.js

Posted: Fri Mar 20, 2015 6:32 pm
by sorin_ristache
Hello,

The "With Frames" link name is generated by XSLT code, it is not set in the page by JavaScript code. However I admit that some labels like "With Frames", "Print this page", etc always default to English regardless of the language of the DITA map, instead of their localized version which should be fetched from the resources\localization\*.xml files. I just fixed this problem in our code for all WebHelp labels, for the next version of Oxygen.

If you want this fix prior to the upcoming Oxygen release (in the next couple of months) please let me know what Oxygen version you use, and I can send you by email a patched file that fixes the problem for you, so that the ditamap language is applied to all labels.

Re: localizing "With Frames" in webhelp_topic.js

Posted: Wed Apr 15, 2015 11:28 pm
by rdelong
Thanks for the file, Sorin. Without changing any of my input settings, this didn't fix my problem. However, if I specified the -Dargs.default.language=$LOCALE%, where %LOCALE% is the current language, then the two variables emits properly.

My source files (all of them) have the @xml:lang attribute set to the respective language. I can't figure out why WebHelp doesn't recognize this attribute value and use that when processing the string values.

I checked the path and name of the localized string files and all appears OK. It's like the plugin cannot find the localized strings.

I'm not sure what to do next.

Re: localizing "With Frames" in webhelp_topic.js

Posted: Thu Apr 16, 2015 9:40 am
by sorin_ristache
The labels in the header area of the page (i.e. do not come from a specific DITA topic file) like the ones for the links With frames and Print this page depend on the @xml:lang attribute set on the root element of the DITA map/bookmap file. So if the @xml:lang attribute is properly set also in the DITA map/bookmap file then you should get the correct translation of these link names, provided you get no error like strings.xml file not found in the list of info messages emitted by the WebHelp transformation (please make sure the option called Show console output - Always is enabled on the Output tab of the transformation for seeing all these info output messages).

If these conditions are met in your DITA WebHelp transformation yet the two link names remain not translated please let us know and we will look into it. Please try also with this Oxygen 17 beta kit and see if the problem persists there.

The args.default.language parameter overrides the @xml:lang language value, this is why that works. But if the @xml:lang attribute is correctly set both in the DITA map/bookmap and in the DITA topics then you should get all the labels correctly translated.

Re: localizing "With Frames" in webhelp_topic.js

Posted: Sun Apr 19, 2015 6:52 am
by rdelong
Thanks for the link to the download, but this plugin has been customized to such a degree that I cannot upgrade at this time. Plus, I'm trying to meet a critical deadline. :wink:

After much troubleshooting, I narrowed down the issue to the com.oxygenxml.webhelp\xsl\dita\dita2webhelp.xsl file.

Under normal JavaScript viewing mode, the hover text, "With Frames" and "Print This Page" appear in the translated language. However, when I switch to Frames mode, the problem appears. The links to "Link to This" and "Print This Page" text is still in English.

Re: localizing "With Frames" in webhelp_topic.js

Posted: Mon Apr 20, 2015 3:59 pm
by sorin_ristache
Until the release of Oxygen version 17.0 which will be in less than a month and which will fix this language problem of the labels, I suggest as workaround to set the args.default.language parameter of the WebHelp transformation to the language of your WebHelp pages.