More gettext functions

Since you can have several mo files, there must be ways to choose between them. The default setting is to use the "default" domain, which means the file, if present. You can change the default text domain using the textdomain() procedure. You can also ask for a single translation from another textdomain like this:


Here, the string "Danish" will be looked up in, and if it exists, the translation will be assigned to a. If no translation exists, or if the file doesn't exist for the current language, the string "Danish" will be assigned to a.

If you want to use a special language, you can switch the default language using the UseLanguage() procedure, which takes the two-letter language code as parameter:

UseLanguage ('da'); // selects Danish

You can also specify a language and a country using the two-letter language and the two letter country code like this:

UseLanguage ('en_US');  // selects American English

The default is to use the language setting in Windows or Linux.