Is it possible to create multilingual help (.chm) file?
I need to create multilingual help (.chm) file for my WPF application. Please suggest best way to create开发者_运维百科 it.
I'd try to steer clear of that if possible. CHM is a proprietary format and, although it has been reverse engineered, I think you'll get far more benefit from doing a truly portable solution like on-disk HTML.
Back when we still used CHM files, we found no easy way to embed multi-language capability into a single file and we had to provide translations in independent CHM files, leading to massive duplication of things like charts, pictures and so forth (this was many years ago so you should check if the situation has improved since then, if you really want to use CHM).
The support for Unicode was, shall we say, less than adequate, and there were numerous security problems which caused many customers to disallow use of CHM files - seriously, who in their right mind allows arbitrary code to be run by a help system?
With on-disk HTML, not only did this duplication disappear (since each language version included common images), we also got much better Unicode support and the ability to have a default front page (in English) with links to alternative front pages for other locales.
And we gained a big boost in portability since it's an open standard. That means we could pretty much run it in any browser on any platform.
And, on top of that, it appears Microsoft don't support it any more. From the Wikipedia CHM article:
In 2002, Microsoft announced security risks associated with the .CHM format, as well as security bulletins and patches. They have since announced their intentions not to develop the .CHM format further.
As the comments in the previous answer state, the CHM format is both a very old format by Microsoft, as well as being proprietary. Distributing HTML files with your application will accomplish the same functionality as a single CHM file. Worrying about the language of the user interface the user will see is more of a non-issue; chances are if the user is reading Italian help, he or she will be using a (1) Italian-localized version of Windows and (2) an Italian-language localized web browser.
That being said, because CHM is an old format and seemingly partially unsupported now, you can generate the same file based on the reversed engineered specification that the CHM files follow. Furthermore, because CHM is merely a binary file format emcompassing HTML files, encoding the HTML files using UTF-8 will accomplish getting the help documents themselves in whichever language you desire.
There is no Microsoft-supported CHM .NET API, so you'll have to output the Binary yourself using Streams / BinaryWriter.
精彩评论