changing system locale in multilanguage compilation - CHM

HM5 served us well, now its time has come and it has been replaced... If you have HM5 questions, please post them here.

Moderators: Alexander Halser, Tim Green

Post Reply
rexpart
Posts: 13
Joined: Sun Sep 06, 2009 9:11 pm

changing system locale in multilanguage compilation - CHM

Unread post by rexpart »

Hello,

in our current help system we compile CHM help files in an automated process (in one batch) where the help files are compiled along with the product itself. Since our products ale localized in over 30 languages, including Asian languages, we had to solve the problem with the need of a computer restart after changing system locale to desired language, which is required for proper compilation of CHM help with Unicode-based language. The workaround we use is to use the command line version of Microsoft AppLocale Utility - SBAppLocale (not allowed to post direct link here yet - please Google AppLocale and SBAppLocale for details - it's the first result), which allows to change the system locale for a particular application without restart and thus compile helps in all languages in one batch. The implementation of AppLocale is easy. You just need to run the html help compiler as a parameter of the AppLocale utility. This example runs the hhc compiler with system locale set to a desired language:

SBAppLocale.exe %LNG% hhc.exe test.hhp

where %LNG% is a numeric variable - language code.

My question is if it is possible to run helpman.exe with a parameter that would allow to set the path to hhc compiler this way (perhaps some undocumented switch ?).

I’ve also experimented a bit with the GUI version, but with no success. This is what I did:

In View > Program Options > Compilers:

- activated Tolerant handling of Asian languages
- changed the path for HTML Help compiler to:

C:\AppLocale\SBAppLocale.exe %LNG% “C:\Program Files (x86)\HTML Help Workshop\hhc.exe“

This doesn’t seem to work. The hhc compiler is started from its original location instead of the changed one and when you look into this settings after publishing a project, it is set back to default for some reason.

Is there any solution or a workaround to this ?
User avatar
Alexander Halser
EC-Software Support
Posts: 4105
Joined: Mon Jun 24, 2002 7:24 pm
Location: Salzburg, Austria
Contact:

Unread post by Alexander Halser »

I recommend to run "helpman.exe" in batch mode through AppLocale. Since the HHC compile process is a child process of Help & Manual, it picks up the temporary locale during compilation. I am not too experienced in working with AppLocale, but know of one customer who does it this way (we've had some tricky conversion problems with Chinese when running over AppLocale, but that should be fine in the current version).
Alexander Halser
Senior Software Architect, EC Software GmbH
rexpart
Posts: 13
Joined: Sun Sep 06, 2009 9:11 pm

Unread post by rexpart »

Alexander Halser wrote:Since the HHC compile process is a child process of Help & Manual, it picks up the temporary locale during compilation
I've made several experiments with Japanese but it doesn't seem to work.

If I run helpman.exe through AppLocale it generates CHM with strange characters in the Index tab:

C:\SBAppLocale_ENG\SBAppLocale.exe 1041 C:\hmcmd\helpman.exe C:\project\testjpn.hmxp /CHM=testjpn.chm


But if I run hhc compiler directly on files in the ~tmpchm folder, the final CHM is ok:

C:\SBAppLocale_ENG\SBAppLocale.exe 1041 "C:\Program Files\HTML Help Workshop\hhc.exe" C:\project\~tmpchm\testjpn.hhp

It looks as if the hhc.exe compiler doesn't inherit the temporary locale from helpman.exe (?).
I've tested it on XP, 2003, Vista, 7 with the same result. Do you have any idea what could be causing this ?
User avatar
Discontinued UweS
Posts: 61
Joined: Mon Apr 26, 2010 5:55 pm
Location: Wood Dale, Illinois, United States

HHC compile for Japanese

Unread post by Discontinued UweS »

If you are using the English version of the html Workshop, for Japanese you need to run it directly on the files for Japanese as you did to make this work correctly.

Alexanders suggestion will only work for Japanese if you use the Japanese version of the HTML Workshop.

I ran into this issue with other HAT products at my work as well.



Uwe
rexpart
Posts: 13
Joined: Sun Sep 06, 2009 9:11 pm

Unread post by rexpart »

Hmm. So it seems that if you don't want to restart the server every time the system locale changes, the only solution with AppLocale is to run hhc directly on files in the \~tmpchm folder. I wish I am wrong :)
User avatar
Discontinued UweS
Posts: 61
Joined: Mon Apr 26, 2010 5:55 pm
Location: Wood Dale, Illinois, United States

Technical Background for Japanese issues

Unread post by Discontinued UweS »

I am dealing with Japanese localization for 2 decades now and therefore I think I can shedd some light on some of the issues.

The "problem" is here that the Japanese localization was taken quite a bit further than all other languages. Japanese was localized all the way down to the DOS level. Thats why you for example see instead of the backslash (\) the symbol for the Japanese Yen (U+00A5 aka ¥).
The Yen symbol often does not escape correctly, and this causes the issues for compiling.

Another pain point, I see often is the Index sort order, because if you use for example Modern Japanese, which includes all 4 scripts, it is alweays a good idea to check the index after compiling.

Therefore, I always treat Japanese separately because it has more "quirks" than other languages. This applies for everything, meaning software, Help manuals, etc.

HTH
Dr. Uwe Schwenk
Quality Translations for the Future!™
E-Mail: dmsus@att.net
rexpart
Posts: 13
Joined: Sun Sep 06, 2009 9:11 pm

Unread post by rexpart »

Thanks for you insight into Japanese, Uwe. I mentioned it just as an example, however. We've the same problem with other exotic languages as well.
And yes, the only problematic part is the Index tab. Everything else seems to be ok in the chm even without changing system locale before compilation. Restarting the server due to the system locale change after every chm compilation in an automated batch process is impossible and AppLocale is a perfect tool to deal with this problem. It would be great if H&M can be used with it somehow.
User avatar
Discontinued UweS
Posts: 61
Joined: Mon Apr 26, 2010 5:55 pm
Location: Wood Dale, Illinois, United States

Language issues

Unread post by Discontinued UweS »

Send me a private email with the issues you have, because I think this goes a bit past H & M. Also include some of the problem languages.

I will look at it over the weekend.

Regards,
Dr. Uwe Schwenk
Quality Translations for the Future!™
E-Mail: dmsus@att.net
scooterchris
Posts: 1
Joined: Mon Jan 10, 2011 5:20 pm

Re: changing system locale in multilanguage compilation - CH

Unread post by scooterchris »

In case it helps anyone else monitoring this thread, here's the method I use to build Simplified Chinese CHM help on a US English system using Microsoft AppLocale:

C:\WINDOWS\AppPatch\AppLoc.exe ""C:\Program Files\EC Software\HelpAndManual5\HelpMan.exe" "help.hmxp" /CHM="help.chm" /I=CHM" "/L0804"

0804 corresponds to the region number for Simplified Chinese.

Note that you also need to set the language in the help.hmxp project or the table of contents in the help file will come out with garbled characters.

In the Help and Manual Project Explorer, the language setting is under "Configuration > Common Properties > Language Settings". The specific setting is "Language of help file".

If you're directly editing the .hmxp file with an automated build tool, the value is:
<config-value name="lcid" translate="true">zh-cn</config-value>
User avatar
Tim Green
Site Admin
Posts: 23186
Joined: Mon Jun 24, 2002 9:11 am
Location: Bruehl, Germany
Contact:

Re: changing system locale in multilanguage compilation - CH

Unread post by Tim Green »

Hi Chris,
In case it helps anyone else monitoring this thread, here's the method I use to build Simplified Chinese CHM help on a US English system using Microsoft AppLocale:
You might be interested in this tutorial with additional components, which explains how to batch compile multiple projects to different locales with AppLocale:

http://helpman.it-authoring.com/viewtop ... =2&t=10295
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.
User avatar
Discontinued UweS
Posts: 61
Joined: Mon Apr 26, 2010 5:55 pm
Location: Wood Dale, Illinois, United States

Re: changing system locale in multilanguage compilation - CH

Unread post by Discontinued UweS »

Tim,

thats a nice tutorial
Dr. Uwe Schwenk
Quality Translations for the Future!™
E-Mail: dmsus@att.net
Post Reply