HP OpenVMS Systems Documentation |
Common Desktop Environment: Help System Author's and Programmer's Guide 14 Native Language SupportContents of Chapter: This chapter identifies files used by the Help System that require modification when a help volume is provided in multiple languages. Internationalized Online HelpIf your product is intended for an international audience, then providing online help in the user's native language is important. The Help System supports the authoring and displaying of online help in virtually any language.When you process a help volume to create run-time help files, the HelpTag software must be told what language and character set you used to author your files. The language and character set information is also used to determine the proper fonts for displaying the help volume. Internationalization FactorsSeveral factors, which are explained in the following section, contribute to providing online help in the user's native language.Character Sets and Multibyte CharactersA character set determines how a computer's internal character codes (numbers) are mapped to recognizable characters. In most languages, single-byte characters are sufficient for representing an entire character set. However, there are some languages that use thousands of characters. These languages require two, three, or four bytes to represent each character uniquely.Character sets supported by the Help System are listed in Table 14-1. However, some characters sets may not exist on all platforms.
Table 14-1 Common Desktop Environment Character Sets When writing HelpTag files, you may use multibyte characters for any help text. However, the HelpTag markup itself (tag names, entity names, IDs, and so on) must be entered using eight-bit characters Language and Territory NamesWhen choosing a language, you select both a character set and a language and territory name. The language and territory name is used to accommodate variations, such as currency and date format, for a given country or region.The language and territory names supported by the Help System are listed in the following table. Before you choose a language, refer to your system documentation to identify the languages and character sets supported on your platform.
Table 14-2 Help System Language and Territory Names (Continued) Locale and Character SetA help volume's default language and character set can be defined as an entity in the helplang.ent file. To specify a complete locale name, combine the language and territory name with the character set name using this syntax:
For a description of the helplang.ent file,
click on: helplang.ent file.Examples
helplang.ent file, then the value is derived from the value of the LANG environment variable.HelpTag SoftwareWhen you process a help volume to create run-time help files, the HelpTag software must be told what language and character set you used to author your files. The language and character set information is used to determine the proper fonts for displaying help topics. If you do not specify a language and character set, HelpTag assumes the default, which is English and ISO-8859-1.
The language and character set can be defined in the helplang.ent file. Or, the character set can be specified as an option on the command line when running
Note: When writing HelpTag files, you may use multibyte characters for any help text. However, the HelpTag markup itself (tag names, entity names, IDs, and so on) must be entered using eight-bit characters. DtHelp Message CatalogThe menus, buttons, and labels that appear in help dialogs should also be displayed in the user's native language. To enable this, Help dialogs read such strings from a message catalog named DtHelp.cat.
The message catalog source file, Refer to your system documentation to determine the correct directory where your new message catalog should be installed. LANG Environment VariableThe user's LANG environment variable is important for two reasons:
See Also
helplang.ent FileThehelplang.ent file defines text entities used by the Helptag software to determine the default locale and character set for a help volume. See "Locale and Character Set" to learn how to specify a language and character set for your help volume.
The
Here is an excerpt from the
Formatting TablesA multibyte language, such as Japanese or Chinese, requires a formatting table. This table specifies a list of characters that cannot start a line and those characters that cannot end a line. When help files are processed, the formatting table ensures that lines wrap correctly. "Creating a Formatting Table" explains how to create a new table or edit the sample table provided in the Help Developer's Kit.Font SchemesOne of the primary functions of the HelpTag software is to convert your marked-up files into a run-time format that the Help System understands. Text is formatted by specifying particular attributes such as type family, size, slant, and weight. A font scheme is simply a name, like an alias, that the Help System uses to assign fonts to HelpTag elements such as heads, procedures, lists, and so forth. It provides a way to map a group of text attributes used by the Help System with specific fonts.Applications that use the standard Common Desktop Environment fonts do not need to define additional font resources. If your application relies on a different set of fonts, you must create and add a font scheme to your application. See Also
Understanding Font SchemesWhen you write a help volume using the HelpTag markup language, you don't specify the fonts and sizes of the text. When you run the HelpTag software, the elements that you've entered are formatted into run-time help files that include text attributes.A font scheme maps text attributes to actual font specifications. For example, if a help topic is formatted using a bold, sans serif typeface, the font scheme identifies which Common Desktop Environment standard font or X font is actually used to display the text. One of the primary uses of font schemes is to provide a choice of font sizes. The HelpTag software formats the body of most topics as 10-point text. However, because the actual display font is determined by the font scheme being used, all 10-point text could be specified to use a 14-point font. Font ResourcesEach font scheme is actually a set of X resources. These resources are read by the application displaying the help. If you want to change the font scheme, you can set font resources in your application's application defaults file.Each resource within a font scheme has this general form: *pitch.size.slant.weight.style.lang.char-set: font specification Where:
Its font resources appear like this within a font scheme:
The char-set field is the only field that cannot use the * (asterisk). To display multibyte languages, such as Japanese or Korean, font resources must be specified using a font set. A font set is actually a group of fonts. A resource entry for a font set is similar to a single font, except a , (comma) separates multiple font names and the specification ends with a : (colon). Here is an example of a fully specified font resource for a Japanese font set.
You can also specify fonts for a multibyte language by providing a minimal XLFD font specification and allowing the system to supply the character set value to produce a font set.
When specifying a font set, remember to end the specification with a : (colon). This instructs the Help System to load a set of fonts to display the information. Font sets are used to display multibyte languages. For volumes containing single-byte information, use the standard font specification.Sample Font SchemesThe /usr/dt/dthelp/fontschemes directory contains four font schemes:
To Choose a Font SchemeEdit the application-defaults file for the application that displays the online help. Replace the current font resources (if any) with the new scheme.If you are making this change just for yourself, copy the application-defaults file into your home directory before editing it. ExampleTo use a larger size font (in the help dialogs) of a personal application namedDtStopWatch , perform these steps:Change to your home directory:
Then copy the DtStopWatch application-defaults file and make it writable:
Edit the DtStopWatch file to add the largest scheme (fontLarge.fns ). Go to the end of the file, and insert the contents of this file:
Save your new DtStopWatch file .
Start the Creating a Formatting TableA multibyte language, such as Japanese or Chinese, requires a formatting table. This table contains three message sets. The first set consists of characters that cannot start a line; the second set lists any characters that cannot end a line; and the third set indicates how to handle newline characters that occur between a single-byte and a multibyte character.
A formatting table is an ASCII file whose file name must end with a Figure 14-1 Sample formatting table
Any line that begins with a $ (dollar sign) followed by a space is a comment. Sample Formatting TableA sample formatting table for a multibyte character set is located in the /usr/dt/dthelp/nls/zh_CN.dt-eucCN directory and is named fmt_tbl.msg.The sample table can be modified by adding or removing characters. To edit the formatting table, use an editor capable of composing characters in the language you have chosen for the help information. If you intend to create help information using a multibyte language, you need to create a formatting table. To Create a Message CatalogIf you translate the DtHelp.msg file, create a new formatting table, or modify the sample table (fmt_tbl.msg ), you must update the message catalog used by the Help System. Use this command syntax to generate the catalog file:
/usr/dt/lib/nls/msg/ lang directory. To install a message catalog, refer to your operating system documentation for guidelines.See Also
Displaying a Localized Help VolumeTo view a help volume created for a locale different from your current system, you must set your LANG environment variable to match the help volume. The value of the LANG environment variable is platform-specific. If you are not familiar with this variable, check with your system administrator for the correct value and procedure to set your environment.Preparing Online Help for International AudiencesThe following checklist summarizes the questions you should answer when providing online help for international audiences.
See Also
|