CHM link to different language

Please post all questions and comments regarding Help & Manual 7 here.

Moderators: Alexander Halser, Tim Green

Post Reply
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

CHM link to different language

Unread post by John Johann »

I use a lightly customised version of "CHM, Skin, Dark Blue Header" to generate our CHM in various languages, e.g. EN, DE, FR.

The information in the different language localisations may deviate from the original. I would like to add buttons to the skin which links to the same topic in another language version.

The skin has the three arrows "back, up, next" in the header -- how do I get three little icons (flags) in there to link to the other CHMs?
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: CHM link to different language

Unread post by Tim Green »

John Johann wrote:The skin has the three arrows "back, up, next" in the header -- how do I get three little icons (flags) in there to link to the other CHMs?
You don't. 8) Those links are exclusively for navigating within the current CHM and shouldn't be messed with. Trying to repurpose them like that is not a good idea.

What you could do is modify the template in the skin to include an additional link to the same topic in a different CHM for the different language version. If you just want to display the current topic from the other language version in the current CHM window it's easy:

Code: Select all

<a href="ms-its:germanhelp.chm::/<%HREF_CURRENT_PAGE%>" class="topiclink">Link Text</a>
The <%HREF_CURRENT_PAGE%> variable inserts the filename of the topic, and provided it's the same in the other CHM file, which you reference after the ms-its: part, and both CHMs are in the same folder (absolute requirement!!!) it will work. Note that you can't use target="_blank" or any target= attribute for this. If you do, the link will just fail.

It gets more complicated if you want to open the other CHM file in a separate CHM viewer instance. Then you have to include a CHM X-Object in the <head> section of your template for every individual link to a different CHM file, like this:

Code: Select all

<object width="0" id="hhctrl_1" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11"><param name="Command" value="ShortCut"><param name="Item1" value=",hh.exe,ms-its:germanhelp.chm::/<%HREF_CURRENT_PAGE%>"></object>
You insert that object directly before the closing </head> tag, then link to it like this:

Code: Select all

<a href="javascript:hhctrl_1.hhclick()" class="filelink">Link Text</a>
The important components here are the id="hhctr_1" in the X-object and the matching hhctrl_1.hhclick() in the link, and of course also the <%HREF_CURRENT_PAGE%> variable in the X-object as well. If you have more than one link like that you would use id="hhctr_2" in the next X-object and hhctrl_2.hhclick() in the corresponding link, and so on. You also need to increment the "Item1" name to "Item2" and so on in each X-object.
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: CHM link to different language

Unread post by John Johann »

Hi Tim,
Thanks -- I meant "in addition to" the arrows. I like using them and also the "Print" button as I use a lot of toggles.

I'll have to try your suggestions and see how I can figure out the paths. The *.chm all have the same names and are in folders de, en, fr, etc.

I'll need to see how that goes as it is a run-time merged set-up so I'm not sure how search etc. will behave.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: CHM link to different language

Unread post by Tim Green »

The *.chm all have the same names and are in folders de, en, fr, etc.
That won't work, neither for linking between the CHMs, nor for any kind of runtime merged CHM configuration. All the CHMs must have different names and must be all in the same folder. This is an absolute restriction of the ancient CHM system. If you can't set it up like that it won't work. Period. :?
I'll need to see how that goes as it is a run-time merged set-up so I'm not sure how search etc. will behave.
If it's a runtime merged setup you really just need the simple link option, since that is all displayed in the same CHM viewer instance anyway.

But again, if you don't have all the CHM files in the same folders nothing is going to work at all. And to be honest, runtime-merging all the different language options with CHM isn't something I would recommend. If you are using CHM in the first place you have full control over the installation process because it is going to be on a Windows computer on a local drive. Just let the user choose the language they want on installation and then ONLY install the CHMs for that language. Then you won't confuse the users with the other languages, and you don't have to jump through hoops linking between CHMs and making an unnecessarily complicated user interface in the help. (Keep. It. Simple. 8) )
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: CHM link to different language

Unread post by John Johann »

Once again thanks for the information.

The current run-time merged structure and file naming conventions may not be written in stone, however, they have been in place for a long time and will be there for another while whether it suits me or not. Ancient or not, it works.

We may have control of the installation, however, users can switch the language after installation on-the-fly so language alternatives need to be available. Our aim is to allow users to access the different language variants.

As for my initial question, there is a documented jscript example explaining how to link to a file outside of your help system. This finds the path to the chm, and with some tweaking can be used to parse the path and link to the desired topic. In my last test, it behaved as desired on the first click (opened the other chm, with the topic in a different language in the same help window) but the second click and later clicks didn't deliver the correct path.
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: CHM link to different language

Unread post by Tim Green »

John Johann wrote:As for my initial question, there is a documented jscript example explaining how to link to a file outside of your help system. This finds the path to the chm, and with some tweaking can be used to parse the path and link to the desired topic. In my last test, it behaved as desired on the first click (opened the other chm, with the topic in a different language in the same help window) but the second click and later clicks didn't deliver the correct path.
Yes, this is possible but I always hesitate to recommend it because of the reliability problems... :?
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
John Johann
Posts: 305
Joined: Mon Aug 21, 2017 7:35 pm

Re: CHM link to different language

Unread post by John Johann »

Hi Tim,
Can you give more information on what reliability problems need to be considered here?
How less reliable is this going to be than the default scripts in the skin, e.g. for toggles, printing, navigation, etc.?
Thanks
User avatar
Tim Green
Site Admin
Posts: 23156
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: CHM link to different language

Unread post by Tim Green »

John Johann wrote:Can you give more information on what reliability problems need to be considered here?
How less reliable is this going to be than the default scripts in the skin, e.g. for toggles, printing, navigation, etc.?
Nothing special, it's just that trying to force CHM to do things like this sometimes doesn't work, as you discovered. However, the CHM skins in the Premium Pack do include a version of this solution that appears to work quite well:

http://www.it-authoring.com/info/pp3hel ... fixer.html
Regards,
Tim (EC Software Documentation & User Support)

Private support:
Please do not email or PM me with private support requests -- post to the forum directly.
Post Reply