LlLocAddDictionaryEntry

Syntax:

INT LlLocAddDictionaryEntry(HLLJOB hJob, LCID nLCID, LPCTSTR pszKey, LPCTSTR pszValue, UINT nType);

Task:

Adds a translation pair to one of the dictionaries. The dictionaries allow the localisation of project resp. Designer items.

Parameter:

hJob: List & Label job handle

nLCID: Windows locale ID specifing the dictionary to which the translation shall be added. This dictionary must already have been declared via LlLocAddDesignLCID().

pszKey: Key for the dictionary (original text in the base language).

pszValue: Translated text for the dictionary.

nType: Dictionary type.

Value

Meaning

LL_DICTIONARY_TYPE_­STATIC

Static (fixed) text

LL_DICTIONARY_TYPE_­IDENTIFIER

Name of field or variable

LL_DICTIONARY_TYPE_­TABLE

Table name

LL_DICTIONARY_TYPE_­RELATION

Relation name

LL_DICTIONARY_TYPE_­SORTORDER

Sortorder name

 

Return Value:

Error code

Hints:

Use this function to use the same project definition file for various localizations. After having added languages via LlLocAddDictionaryEntry() the Designer toolbar will offer a button for choosing the language. LL_DICTIONARY_TYPE_­STATIC allows the localization of static text by using the Translate$ Designer function including Intellisense support. The static text may contain up to three placeholders which are marked as {0}, {1} and {2}.

At print time the used language will be automatically set according to the thread locale ID (which is the system language by default). If you want to set a specific language as the default, use LL_OPTION_LCID. This default setting can be overruled by the end-user via the Designer.

For clean up purposes, set pszKey and pszValue to NULL and nType to 0. This will delete all dictionary entries from all dictionary types.

Example:

HLLJOB hJob;

hJob = LlJobOpen(CMBTLANG_­DEFAULT);

// Add languages
LlLocAddDesignLCID(hJob, 9); // English as base language
LlLocAddDesignLCID(hJob, 7); // German as translation language

// Add translations
LlLocAddDictionaryEntry(hJob, 7, "ArticleNumber", "Artikelnummer",
         LL_DICTIONARY_TYPE_IDENTIFIER);
LlLocAddDictionaryEntry(hJob, 7, "Price", "Preis",
         LL_DICTIONARY_TYPE_IDENTIFIER);
LlLocAddDictionaryEntry(hJob, 7, "Page {0} of {1}", "Seite {0} von {1}",
         LL_DICTIONARY_TYPE_STATIC);

LlDefineVariableStart(hJob);
LlDefineVariable(hJob, "ArticleNumber", "12345");
LlDefineVariable(hJob, "Price", "123");

// Invoke Designer etc.
...
LlJobClose(hJob);

See also:

LlLocAddDesignLCID, LL_OPTION_LCID