Internationalization

Members

Static functions

dcgettext
string dcgettext(string domain, string msgid, int category)

This is a variant of g_dgettext() that allows specifying a locale category instead of always using LC_MESSAGES. See g_dgettext() for more information about how this functions differs from calling dcgettext() directly.

dgettext
string dgettext(string domain, string msgid)

This function is a wrapper of dgettext() which does not translate the message if the default domain as set with textdomain() has no translations for the current locale.

dngettext
string dngettext(string domain, string msgid, string msgidPlural, gulong n)

This function is a wrapper of dngettext() which does not translate the message if the default domain as set with textdomain() has no translations for the current locale.

dpgettext
string dpgettext(string domain, string msgctxtid, size_t msgidoffset)

This function is a variant of g_dgettext() which supports a disambiguating message context. GNU gettext uses the '\004' character to separate the message context and message id in msgctxtid. If 0 is passed as msgidoffset, this function will fall back to trying to use the deprecated convention of using "|" as a separation character.

dpgettext2
string dpgettext2(string domain, string context, string msgid)

This function is a variant of g_dgettext() which supports a disambiguating message context. GNU gettext uses the '\004' character to separate the message context and message id in msgctxtid.

getLanguageNames
string[] getLanguageNames()

Computes a list of applicable locale names, which can be used to e.g. construct locale-dependent filenames or search paths. The returned list is sorted from most desirable to least desirable and always contains the default locale "C".

getLocaleVariants
string[] getLocaleVariants(string locale)

Returns a list of derived variants of locale, which can be used to e.g. construct locale-dependent filenames or search paths. The returned list is sorted from most desirable to least desirable. This function handles territory, charset and extra locale modifiers. See `setlocale(3)` for information about locales and their format.

stripContext
string stripContext(string msgid, string msgval)

An auxiliary function for gettext() support (see Q_()).