Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Common Desktop Environment: Internationalization Programmer's Guide > Chapter 2 Internationalization and the Common Desktop Environment

Localized Resources

» 

Technical documentation

» Feedback
Content starts here

 » Table of Contents

 » Index

This section describes which widget and gadget resources are locale-sensitive. The information is organized by related functionality. For example, the first section describes those resources that are locale-sensitive for widgets used to display labels or to provide push-button functionality.

Labels and Buttons

Table 2-2 “Localized Resources” lists the localized resources that are used as labels. Many of them are of type XmString. The rest are of type color or char*. See the Motif Reference Manual for detailed descriptions of these resources. In each case, the application should not hardcode these resources. If resource values need to be specified by the application, it should be done with the app-defaults file, ensuring that the resource can be localized.

Only the widget class resources are listed here; subclasses of these widgets are not listed. For example, the XmDrawnButton widget class does not introduce any new resources that are localized. However, it is a subclass of the XmLabelWidget widget class; therefore, its accelerator resource, acceleratorText resource, and so on, are also localized and should not be hardcoded by an application.

Table 2-2 Localized Resources

Widget Class

Resource Name

Core

*background:[1]

XmCommand

*command:

XmCommand

*promptString:

XmFileSelectionBox

*dirListLabelString:

XmFileSelectionBox

*dirTextLabelString:

XmFileSelectionBox

*fileListLabelString:

XmFileSelectionBox

*filterLabelString:

XmFileSelectionBox

*noMatchString:

XmLabel[Gadget]

*accelerator:

XmLabel[Gadget]

*acceleratorText:

XmLabel[Gadget]

*labelString:

XmLabel[Gadget]

*mnemonic:

XmLabel[Gadget]

*stringDirection:

XmList

*stringDirection:

XmManager

*stringDirection:

XmMessageBox

*cancelLabelString:

XmMessageBox

*helpLabelString:

XmMessageBox

*messageString:

XmMessageBox

*okLabelString:

XmPrimitive

*foreground:[1]

XmRowColumn

*labelString:

XmRowColumn

*menuAccelerator:

XmRowColumn

*mnemonic:

XmRowColumn(SimpleMenu*)

*buttonAccelerators:

XmScale

*titleString:

XmSelectionBox

*applyLabelString:

XmSelectionBox

*cancelLabelString:

XmSelectionBox

*helpLabelString:

XmSelectionBox

*listLabelString:

XmSelectionBox

*okLabelString:

XmSelectionBox

*selectionLabelString:

XmSelectionBox

*textAccelerators:

[1] The foreground and background colors are not localized due to restrictions in the X protocol that require color names to be limited to the portable character set. Localized color names are left to applications to provide a localized database to map to a name encoded with the portable character set.

 

Note that the XmRowColumn widget has additional string resources that may be localized. These resources are listed in the XmRowColumn man page, under the heading "Simple Menu Creation Resource Set." As the title implies, these resources affect only RowColumn widgets created with the XmCreateSimpleMenu() function. The resources affected are: *buttonAccelerators, *buttonAcceleratorText, *buttonMnemonics, *optionLabel, and *optionMnemonic. These resources are not included in Table 2-2 “Localized Resources” because they are rarely used and apply to RowColumn only when creating a simple menu.

List Resources

Several widgets allow applications to set or read lists of items in the widget. Table 2-3 “Resources Used for Reading Lists” shows which widgets allow this and the resources they use to set or read these lists. Because the list items may need to be localized, do not hardcode these lists. Rather, they should be set as resources in app-defaults files, allowing them to be localized. The type for each list is XmStringList.

Table 2-3 Resources Used for Reading Lists

Widget Class

Resource Name

XmList

*items:

XmList

*selectedItems:

XmSelectionBox

*listItems:

 

Title

Table 2-4 “Resources Used for Setting Titles and Icon Names” lists the resources used for setting titles and icon names. Normally, an application need only set the *title: and *iconName: resources. The encoding of each is automatically detected for clients doing proper locale management. All of these are of type *char or XmString.

Table 2-4 Resources Used for Setting Titles and Icon Names

Widget Class

Resource Name

TopLevelShell

*iconName:

TopLevelShell

*iconNameEncoding:[1]

WmShell

*title:

WmShell

*titleEncoding:1

XmBulletinBoard

*dialogTitle:

[1] This resource should not be set by the application. If the application calls XtSetLanguageProc, the default value (None) of this resource will automatically be set, ensuring that localized text can be used for the title.

 

Text Widget

Table 2-5 “Locale-Sensitive Text[Field] Resources” lists the Text[Field] resources that are locale-sensitive or about which the developer of an internationalized application should know.

Table 2-5 Locale-Sensitive Text[Field] Resources

Widget Class

Resource Name

XmSelectionBox

*textColumns:[1]

XmSelectionBox

*textString:

XmText

*columns:1

XmText

*modifyVerifyCallback:

XmText

*modifyVerifyCallbackWcs:

XmText

*value:

XmText

*valueWcs:

XmTextField

*columns:1

XmTextField

*modifyVerifyCallback:

XmTextField

*modifyVerifyCallbackWcs:

XmTextField

*value:

XmTextField

*valueWcs:

[1] The *columns resource specifies the initial width of the Text[Field] widget in terms of the number of characters to be displayed. In the case of a variable width font or in a locale where the size of a character varies significantly, a column is the amount of space required to display the widest character in that locale's character repertoire. For example, a column width of 10 guarantees that at least 10 characters of the current locale can be displayed; it is possible (likely) that more than that number of characters can be displayed in the allocated space.

 

Input Method (Keyboards)

Table 2-6 “Localized Resources for Input Method Customization” lists localized resources for customizing the input method. These resources allow the user or the application to control the input method that will be used for the specified locale, the policy to follow when creating an input context (per shell or per individual widget), and the preedit style (if applicable and available) that will be used.

Table 2-6 Localized Resources for Input Method Customization

Widget Class

Resource Name

VendorShell

*inputMethod:

VendorShell

*preeditType:

VendorShell

*verifyPreedit:

 

Layout Direction

The table that follows shows widgets that may use the *layoutDirection resource.

Table 2-7 The layoutDirection Resource

Widget Class

Resource Name

VendorShell

*layoutDirection:

XmGadget

*layoutDirection:

XmMenuShell

*layoutDirection:

XmPrimitive

*layoutDirection:

XmManager

*layoutDirection:

 

Pixmap (Icon) Resources

Table 2-8 “Pixmap Resources” lists pixmap resources. In some cases, a different pixmap may be needed for a given locale.

Table 2-8 Pixmap Resources

Widget Class

Resource Name

Core

*backgroundPixmap:

WMShell

*iconPixmap:

XmContainers

*collapsedStatePixmap: and *expandedStatePixmap:

XmDragIcon

*pixmap:

XmDragIcon

*mask:

XmDropSite

*animation[Mask|Pixmap]:

XmGadget

*backgroundPixmap:

XmLabel[Gadget]

*labelInsensitivePixmap:

XmLabel[Gadget]

*labelPixmap:

XmMessageBox

*symbolPixmap:

XmPushButton[Gadget]

*armPixmap:

XmToggleButton[Gadget]

*selectInsensitivePixmap:

XmToggleButton[Gadget]

*selectPixmap:

XmToggleButton[Gadget]

*indeterminatePixmap:

XmIconPixmap

*[large|small]IconPixmap:

 

For complete information on these resources, refer to Motif Programmer's Guide.

Font Resources

Table 2-9 “Localized Font Resources” lists the localized font resources. All XmRenderTable resources are of type XmRenderTable. In almost all cases, a fontset should be used when specifying a rendition table. The only exception is when displaying character data that does not appear in the character set of the user (for example, displaying math symbols or dingbats).

Table 2-9 Localized Font Resources

Widget Class

Resource Name

VendorShell

*buttonFontList:

VendorShell

*buttonRenderTable:

VendorShell

*defaultFontList:

VendorShell

*labelFontList:

VendorShell

*labelRenderTable:

VendorShell

*textFontList:

VendorShell

*textRenderTable:

XmBulletinBoard

*buttonFontList:

XmBulletinBoard

*buttonRenderTable:

XmBulletinBoard

*labelFontList:

XmBulletinBoard

*labelRenderTable:

XmBulletinBoard

*textFontList:

XmBulletinBoard

*textRenderTable:

XmComboBox

*renderTable:

XmContainer

*renderTable:

XmLabel[Gadget]

*renderTable:

XmList

*renderTable:

XmMenuShell

*buttonFontList:

XmMenuShell

*renderTable:

XmMenuShell

*defaultFontList:

XmMenuShell

*labelFontList:

XmMenuShell

*renderTable:

XmText

*renderTable:

XmScale

*renderTable:

XmTextField

*renderTable:

XmIconGadget

*renderTable:

 

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.