Cicode Programming Reference > Cicode Function Categories > Miscellaneous Functions Introduction > SetLanguage

SetLanguage

Sets the language database from which the local translations of native strings in the project will be drawn, and specifies the character set to be used. Native strings are those that are preceded by a @, and enclosed in brackets (for example, @(Motor Overload)).

This function will dynamically change the language of display items such as alarm descriptions, button text, keyboard/alarm logs, graphic text, Cicode strings etc. The language will only be changed on the client that calls the function. This means that you can display different languages at different clients, even though they are running the same project.

If the local language character set differs from the default character set of the Windows installation, the runtime text may be garbled. You can set the local language and character set by using this function, or through the [Language]LocalLanguage and [Language]CharSet Parameters.

Syntax

SetLanguage(sLanguage, nCharSet)

sLanguage:

The name of the language database from which the local translations of native strings in the project will be drawn. The .dbf extension is optional.

nCharSet:

The character set to use when displaying the localized text in runtime:

0

ANSI

1

Default

128

Japanese - Shiftjis

129

Korean - Hangul

130

Korean - Johab

134

Chinese - simplified

136

Chinese - traditional

161

Greek

162

Turkish

163

Vietnamese

177

Hebrew

178

Arabic

186

Baltic

204

Russian

222

Thai

Return Value

0 (zero) if successful, otherwise 262 (the file could not be opened).

Related Functions

LanguageFileTranslate, StrToLocalText

Example

SetLanguage("French",1);
! Changes the current language to French, using the Windows default character set.

See Also

Miscellaneous Functions