| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Using the Natural Language Facilities

To use the natural language facilities that G2 provides, you can:

G2 provides system-defined localizations for some languages. To use these capabilities, you can:

Setting the Current Language

The current language is part of a KB's knowledge and is set through the Current-language attribute of the Language Parameters system table. The default is english.

To change the current language:

If language translations for the new language exist in the KB, localized menus and facilities are displayed.

The current language does not affect existing symbol and text values entered in supported languages. For example, if you set the current language to russian, and create messages in cyrillic, or name items using cyrillic characters, changing the current language to japanese does not alter the cyrillic messages and item names that you entered.

Effect of Current Language Setting

For system-defined localizations, the effect of changing the current language in a KB depends on:

Changing the current language to one of these languages immediately localizes the editor and Inspect buttons:

Changing the current language does not change the system-defined menu choices unless the corresponding KB is loaded. For example, changing the Current-language attribute to korean immediately localizes the facility buttons, but does not translate the menu choices until you load the korean.kl file.

Loading the appropriate KB file localizes the G2 menu choices as follows:

Language Kb to load: Menu localizations:
japanese
japanese.kl
Yes
korean
korean.kl
Yes
russian
Not available
No
french
language.kl
No
german
language.kl
Yes
italian
language.kl
Yes
portugues
language.kl
No
spanish
language.kl
Yes
swedish
language.kl
Yes

User-defined localizations can be added through the use of the language translation facilities as described in Localizing Menu Choices and G2 Facilities.

Two command line options can affect the current language:

Setting a Default-language for a G2 Session

The -default-language command line option and its corresponding environment variable, G2_DEFAULT_LANGUAGE, is only for G2. You can set a default language only by starting G2 with the -default-language command-line option.


Hint: If you start G2 with the -default-language command when an environment variable exists for a different language, the command line option overrides the environment variable.

Once you start G2 with a default language, that language persists for the entire G2 session with any KB whose current language is english. Loading a KB with a different current language or changing the system table's Current-language attribute overrides the default language.

The purpose of the default language command line option is to set a common language for the entire G2 session, which can be overridden as necessary. For example, if multiple developers accessing a KB through Telewindows are French, you could start G2 with the default-language francais.

If one Telewindows user wanted to use the German menu options, that user could change the language to German in his or her window in the G2 Login dialog. Changing the language of a Telewindows connection is described in Supporting a Window-Specific Language.

Setting a Language for the Current Window

The -language command line option, applicable to both G2 and Telewindows, affects only the current window, which is the local window for G2. It does not change G2's default language or the KB's current language.

One way to use this option is in conjunction with the default language option. You could start G2 with a default language. Any Telewindows user who wanted an alternative language could then connect to G2, using the -language option with the language they chose.

Connecting to G2 this way would alleviate the need for a Telewindows user to change the current language.

Supporting Multiple Languages in a KB

If your KB requires multiple language support, you can provide it by changing the Current-language attribute each time you need to enter text in that language.

As an example, the next diagram shows one way to provide access to several languages programmatically through the use of action buttons. Each of the buttons uses a conclude action to change the value of the Current-language attribute to a different language. The text of the Italian action button is shown, along with the sample Main Menu, demonstrating how a menu appears when the current language is Italiano.


| Prev | Next | Start of Chapter | End of Chapter | Contents | Glossary | Index | Comments | (4 out of 9)

Copyright © 1997 Gensym Corporation, Inc.