Up: Extended Commands   [Contents][Index]


B.3.1 lang extensions

These experimental extensions allow the administrator to group databases into classes depending on the language of their headwords (the language they translate from, or the source language) and the one the definitions are written in (the language they translate from, or the destination language).

The two languages are declared in the database definition in the dicod configuration file (see Databases) using the languages-from and languages-to configuration statements:

Database: languages-from lang

Sets the database source language. The lang argument is normally the ISO 639 language code, although dicod does not enforce that in any way. More than one lang may be specified in case the database contains headwords in several languages.

Database: languages-to lang

Defines the database destination language. The lang argument is as described above.

For example:

database {
    name "en-fr";
    language-from "en";
    language-to "fr";
};

The client may use the following commands to declare the preferred languages and list the databases and their languages.

Command: OPTION LANG
Command: OPTION LANG source-list : dest-list

Declares the sets of source and destination languages. Only databases supporting at least one of these langages will be visible for the client. Any or both of these lists may be empty, which means any language is acceptable. For example:

OPTION LANG pl cz :
250 ok - set language preferences

The statement above informs the server that the client is interested only in databases that contain keywords in Polish and Czech languages.

The statement

OPTION LANG :

empties both lists. Consequently, all databases become visible again. This is the default.

Used without arguments, this statement has the same effect as OPTION LANG :.

Command: SHOW LANG PREF

Displays the currently selected source and destination languages:

SHOW LANG PREF
280 pl cz :
Command: SHOW LANG DB
Command: SHOW LANG DATABASES

Lists the visible database along with the languages they support:

SHOW LANG DB
110 3 databases present
gcide en : en
polish-english pl : en
czech-franch cz : fr
.
250 ok
Command: SHOW LANG INFO dbname

Shows the languages supported by the database dbname. E.g.:

show lang info gcide
280 en : en

Up: Extended Commands   [Contents][Index]