TranslateControl (translate text for a control)

Top  Previous  Next

 

TranslateControl( control [,window] ), VIRTUAL

TranslateControl

Translates text for a control.

Control

An integer constant, variable, EQUATE, or expression containing the control number of the control to translate.

Window

The label of the APPLICATION, WINDOW, or REPORT to translate. If omitted, TranslateControl operates on the active target.

The TranslateControl method translates the text for the specified control. The AddTranslation method sets the translation values for the control text.

Implementation:

The TranslateControl method calls the TranslateString method for the specified control. Where applicable, the TranslateControl method translates MSG attribute text, TIP attribute text, and FORMAT attribute text.

The TranslateControl method does not translate USE variable contents; therefore it does not translate STRING controls that display a variable, nor the contents of ENTRY, SPIN, TEXT, or COMBO controls. You can use the TranslateString method to translate these elements if necessary.

Example:

PWindow WINDOW('Preferences'),AT(,,89,34),IMM,SYSTEM,GRAY

   CHECK('&Sound'),AT(8,6),USE(Sound),VALUE('ON','OFF')

   PROMPT('&Volume'),AT(31,19),USE(?VolumePrompt)

   SPIN(@s20),AT(8,20,21,7),USE(Volume),HVSCROLL,RANGE(0,9),STEP(1)

   BUTTON('OK'),AT(57,3,30,10),USE(?OK)

       END

 

CODE

OPEN(PWindow)

Translator.TranslateControl(?Sound)        !translate Sound check box

Translator.TranslateControl(?VolumePrompt) !translate Volume prompt

ACCEPT                                     !leave OK button

END                                        !and window title bar alone

See Also:     AddTranslation, TranslateString