You are on page 1of 4

APPENDIX B

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:

How to configure multi-language projects

How to switch languages at runtime

B-2

Citect Configuration Training Manual

Configuring the Multi-Language features in Citect


To mark text to be changed to a different language at runtime:
Type the text in the following format:
@(Native Text)

Where Native Text is the text to be displayed at configuration time. This text will be
replaced by the local equivalent at runtime.

To set the runtime language:


Change the [Language]LocalLanguage parameter to the required language a
language database by that name will then be created.

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.

To change the language at runtime:


Call the cicode function SetLanguage()

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

Use the @(English) language


database

Use the @(French) language


database

2.

Below the two buttons, use the Text tool

Appearance (General)
Text

to draw the following object:

@(What's your language?)

3.

Save your page.

4.

Create the language database with the following equivalents:

NATIVE

LOCAL

English

Anglais

French

Francais

Whats your language?

Quelle langue parlez-vous?

i.

Change the [Language]LocalLanguage parameter to French.

ii.

Compile (without running) your project (use the Compile Project


Project Editor).

iii.

Change the [Language]LocalLanguage parameter back to English.

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

Citect Configuration Training Manual

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.

In Microsoft Excel: Close the document answer No to the question:

Do you want to save the changes you made to French.DBF?.

3.

Run the project.

4.

Go to the Utility page and click on the English (Anglais) and French (Francais)
buttons to test your multi-language additions.

5.

Shutdown the project.

You might also like