Preparing Output for Multiple or Foreign Languages
Abstract
I hope that this article will serve as a succinct reference regarding locales and non-English output. It will cover the settings and features of the ePublisher Platform (and specifically WebWorks Help 5.0 output) that relate to projects distributed to foreign countries.
Contents
Localized Tabs & Buttons
The WebWorks Help 5.0 output format was designed with the ability to adapt to the end user's local settings in such a way that the text on tabs and buttons will change according to the locale defined on the user's system. When you generate WWHelp output, ePublisher stores all of the locales in an XML file that is distributed with the output. When the output is launched, a script in a file called browser.js runs and checks the User Agent settings. These are settings associated with the browser (including the language, the version, etc.). We use the information reported by the browser to update the look and feel of the output. That is, if the browser tells us that the User Agent language is French, then we use the French values (as defined in locales.xml) for the buttons and tabs, etc. You can add additional locales by performing an override on locales.xml. For details, see the Resources below.
There are different ways to change the User Agent language. The IE language is tied to the Windows language. If you choose “Regional and Language Options” from the Control Panel, you can change the language used by certain programs on the first tab (Regional Options). If you switch this to French and, your WebWorks Help 5.0 output will use the French locale settings. Unfortunately, FireFox doesn’t work this way. You have to download the French locale add-on as well as a handy “locale-switcher” add-on that lets you change the browser locale on-the-fly (or, you could just install the full French version of FireFox). If you succeed in switching the locale, the tabs and buttons in your WWHelp output will reflect the change (after refreshing the view).
The Output Locale
It should be noted, however, that all of this is unrelated to the “Locale” option in the ePublisher Pro Format Settings. We embed the value of the Locale option in the HTML tag of each output file. This is useful if you are generating output that is authored in a given language, but it doesn’t affect the appearance or behavior of the output directly (at least for WebWorks Help 5.0). For example, if you set the locale to “FR”, then things like search engine spiders, browser dictionaries, and translation services will recognize the content of your output as French. Your TOC tab will still read “Contents,” though, unless your User Agent language (browser locale) is set to French. If that is the case, then your TOC tab should read “Table des matières.”
Other output formats (e.g., Dynamic HTML) use the Locale setting to localize the buttons and captions at the time of conversion. For example, if you set the Locale setting in your project to "FR", then the navigation buttons (well, alt text associated with them) will appear in French, regardless of User Agent settings.
Summary
To recapitulate, the WebWorks Help 5.0 output is distributed with a number of different built-in locales. This way, the correct labels for tabs and buttons will be displayed no matter where in the world it is viewed, according to the user’s browser/OS settings. If your content is authored in a foreign language, though, you should set the ePublisher locale (which equates to a “LANG” tag in the HTML) to correspond to that language so that it is processed correctly by various online entities.
Resources
ePublisher Locales:
FireFox Locales: