background image
<< Internationalization - Internationalizing tags | Part IV - Customizing SilkTest >>
Internationalization - Load string variables with the localized strings
<< Internationalization - Internationalizing tags | Part IV - Customizing SilkTest >>
284
User's Guide
14 S
UPPORTING
I
NTERNATIONALIZED
A
PPLICATIONS
Internationalizing tags
const LANGUAGETYPE LANGUAGE = LT_EN
Load string variables
with the localized
strings
The final step is to create and initialize a
STRING
variable for each object in
the application, as shown in this example:
STRING sFile = {"Datei", "File", "Archivo"}[LANGUAGE]
STRING sNew = {"Neu", "New", "Nuevo"}[LANGUAGE]
STRING sOpen = {"?ffnen", "Open", "Abrir"}[LANGUAGE]
STRING sSave = {"Speichern", "Save", "Guardar"}[LANGUAGE]
STRING sSaveAs = {"Speichern unter","Save As", "Guardar como"}[LANGUAGE]
STRING sExit = {"Beenden", "Exit", "Salir"}[LANGUAGE]
STRING sFind = {"Suchen", "Find", "Buscar"}[LANGUAGE]
STRING sWhatText = {"Suchen nach:", "Find What:", "Buscar"}[LANGUAGE]
STRING sWhat = {"Suchen nach:", "Find What:", "Buscar"}[LANGUAGE]
STRING sDirection = {"Suchrichtung", "Direction", "Direcci?n"}[LANGUAGE]
STRING sUp = {"Aufw?rts", "Up", "Arriba"}[LANGUAGE]
STRING sDown = {"Abw?rts", "Down", "Abajo"}[LANGUAGE]
STRING sFindNxt={"Weitersuchen","Find Next",Buscar siguiente"}[LANGUAGE]
STRING sCancel = {"Abbrechen", "Cancel", "Cancelar"}[LANGUAGE]
Each of those statements picks a value from a list based on the language,
which serves as the index into the list. For example, if
LANGUAGE
is
LT_EN
,
which is the second member of the enumerated data type
LANGUAGETYPE
,
then the first statement would evaluate to:
STRING sFile = {"Datei", "File", "Archivo"}[2]
So sFile would be assigned the value "File", which is the second element in
the list. For more information about using lists, see "
LIST
data type" in online
Help.
Note If your application uses distinct captions/labels for each GUI,
then you should create multiple versions of each
STRING
variable
using GUI specifiers. See Chapter 13, "Porting Tests to Other
GUIs", for mo
re information. An alternative approach is to create a
two-dimensional list of strings, and use the GUI type and the
language as the indices.