localizing "With Frames" in webhelp_topic.js

Having trouble installing <oXygen/>? Got a bug to report? Post it all here.
rdelong
Posts: 71
Joined: Tue Oct 21, 2014 10:01 pm

localizing "With Frames" in webhelp_topic.js

Post by rdelong » Thu Mar 19, 2015 8:34 pm

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"?

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: localizing "With Frames" in webhelp_topic.js

Post by sorin_ristache » Fri Mar 20, 2015 6:32 pm

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.
Regards,
Sorin

<oXygen/> XML Editor Support

rdelong
Posts: 71
Joined: Tue Oct 21, 2014 10:01 pm

Re: localizing "With Frames" in webhelp_topic.js

Post by rdelong » Wed Apr 15, 2015 11:28 pm

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.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: localizing "With Frames" in webhelp_topic.js

Post by sorin_ristache » Thu Apr 16, 2015 9:40 am

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.
Regards,
Sorin

<oXygen/> XML Editor Support

rdelong
Posts: 71
Joined: Tue Oct 21, 2014 10:01 pm

Re: localizing "With Frames" in webhelp_topic.js

Post by rdelong » Sun Apr 19, 2015 6:52 am

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.

sorin_ristache
Posts: 4144
Joined: Fri Mar 28, 2003 2:12 pm

Re: localizing "With Frames" in webhelp_topic.js

Post by sorin_ristache » Mon Apr 20, 2015 3:59 pm

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.
Regards,
Sorin

<oXygen/> XML Editor Support

Post Reply