Translation
The library publishes an implementation of the so-called gettext system for automatic translation of text strings in a program. This system relies on message catalog files containing for each message of the application both the English version and its translation in a particular language (there is therefore one message catalog file per language and application). The message catalog files are organised in a dedicated directory hierarchy: the root directory of the localisation data (usually named locale) contains one sub-directory per language named after its ISO 639 code (for instance de for German, it for Italian etc). The message catalogs for a given language are stored under the LC_MESSAGES sub-directory of this language specific directory. Each message catalog file has the name of the domain it provides translations for (typically the name of the application) with the extension .mo (Machine Object). An mo file is generated using the command xprnls mogen (see Section XPRNLS Command line tool) from a po file (Portable Object).
A program using the XPRNLS translation framework must first open the domain for which it needs translations using XNLSopenmsgdom in order to get a domain descriptor. Then each message translation can be obtained by applying XNLSgettext to the English version of the text: the translated message is returned if the message catalog file for the current language has been found and includes the translation. Otherwise the original English text is used as the return value.
XNLSclosemsgdom |
Close a message domain.
|
XNLSfindmsgdom |
Find an open message domain based on its name.
|
XNLSgettext |
Get the translation of a text string.
|
XNLSopenmsgdom |
Open a message domain.
|
XNLSsetlang |
Set or get the active language for message translation.
|
XNLSsetlocaledir |
Define the default or domain specific locale directory.
|
© 2001-2019 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.