Professional Documents
Culture Documents
Apéndice B - Language
Apéndice B - Language
Multi-Language Projects
The language switching facility in Citect allows you to use one language to configure
a project and another for runtime text items such as alarm descriptions, button text,
keyboard/alarm logs, graphic text, Cicode strings etc. You can also dynamically
change languages during runtime. For example, if your native language is English,
you could enter an English alarm description when configuring the project, but specify
to display it in the French or German (or any other language) equivalent at runtime.
The desired language can be specified before you run the project, or changed
dynamically at runtime.
Citect distinguishes between what is termed the Native Language (eg. the language of
the developer) and the Local language (eg. the language of the end user). Language
changes are achieved by means of a language database, which has a field for native
text, and a field for the translated local text. Basically, when the project is run, any
native text will be replaced with the equivalent local text.
Alarm and keyboard logs can be processed in both the native and the local language.
This means that both native and local users can read the historical logs. The data can
be logged to the same device, or to separate devices.
Chapter Objectives
In this chapter you will learn:
B-2
Where Native Text is the text to be displayed at configuration time. This text will be
replaced by the local equivalent at runtime.
NOTE: To set the LocalLanguage parameter, locate the help topic Parameters
Language and open the help on the LocalLanguage parameter. There is a
button to view and edit the parameter.
Example
Setting LocalLanguage=French will result in a language database called
French.DBF being created in the project directory when the project is compiled.
Edit the French.DBF file with a database editor and add the language
equivalents.
Create a button to call the function SetLanguage(French,1) to change the
language to French at runtime.
Multi-Language Projects
B-3
Exercise
In this exercise we will add two buttons to change the language at runtime from English to
French and one text object that will display in either language.
1.
Add the two buttons to the Utility page in your project, as described:
Button Text
@(English)
@(French)
Execute
command
SetLanguage(English,1
)
SetLanguage(French,1
)
Tool Tip
2.
Appearance (General)
Text
3.
4.
NATIVE
LOCAL
English
Anglais
French
Francais
i.
ii.
iii.
iv.
Open the French.DBF file in your project directory using Microsoft Excel.
v.
In Microsoft Excel: Next to the text shown above in the NATIVE column, enter
the corresponding text in the LOCAL column.
button in
B-4
vi.
In Microsoft Excel: Use File | Save As to save the file with the name
French.DBF into your project directory (use dBaseIII format). Answer Yes to
the question:
The file French.DBF already exists. Do you want to replace the existing file?
vii.
3.
4.
Go to the Utility page and click on the English (Anglais) and French (Francais)
buttons to test your multi-language additions.
5.