translate()
Translates a term.
Synopsis
int translate(string inMeta, string &inTarget, int langIdx|OaLanguage
lang);
Parameters
Parameter | Description |
---|---|
inMeta | Term in original (meta) language |
&inTarget | Translation |
langIdx | ID of the language or the language into which the term is translated |
Return value
In the event of an error -1, otherwise 0.
Errors
missing or incorrect arguments
Description
Translates the term inMeta from the meta language into the language numbered langIdx and writes the translation to inTarget. The number langdlx refers to the order of the langs entries in the config file. The count starts at zero.
A valid translateConfig entry must exist in the config file, [general] section, for example,
[general]
...
translateConfig = "dictionary.dat" "|"
This entry points to the dictionary file (must be in the config directory), and the delimiter used for the meta language (terms can consist of several words to be translated as a whole - this requires additional delimiters). The delimiter between two languages in the dictionary is exactly one TAB.
Returns the name of the meta language term "Schwelle" in the language indexed as 0.
main()
{
string s;
DebugN(translate("Schwelle", s, 0));
DebugN(s);
}
Assignment
Multi-language capability
Availability
CTRL