|
open-vm-tools 12.5.2
|
Functions and macros to help with internationalization of applications. More...
Macros | |
| #define | MSG_MAGIC "@&!*@*@" |
| #define | MSG_MAGIC_LEN 7 |
| #define | MSGID(id) |
| #define | SU_(msgid, en) |
Functions | |
| G_BEGIN_DECLS void | VMTools_BindTextDomain (const char *domain, const char *locale, const char *catdir) |
| const char * | VMTools_GetString (const char *domain, const char *msgid) |
Functions and macros to help with internationalization of applications.
To create a localizable string, use the MSGID macro in the following manner:
Or, in shorthand form:
This will instruct the code to retrive the message under key "message.id" in the translation catalog for the configured locale.
The shorthand macros use the VMW_TEXT_DOMAIN macro to identify the domain from which translated messages will be loaded. Each domain should first be initialized by calling VMTools_BindTextDomain().
| #define MSGID | ( | id | ) |
| #define SU_ | ( | msgid, | |
| en ) |
Shorthand macro to retrieve a localized message in UTF-8.
| [in] | msgid | The message ID. |
| [in] | en | English version of the message. |
| G_BEGIN_DECLS void VMTools_BindTextDomain | ( | const char * | domain, |
| const char * | lang, | ||
| const char * | catdir ) |
Loads the message catalog for a text domain. Each text domain contains a different set of messages loaded from a different catalog.
If a catalog has already been bound to the given name, it is replaced with the newly loaded data.
| [in] | domain | Name of the text domain being loaded. |
| [in] | lang | Language code for the text domain. |
| [in] | catdir | Root directory of catalog files (NULL = default). |
| const char * VMTools_GetString | ( | const char * | domain, |
| const char * | msgid ) |
Returns a localized version of the requested string in UTF-8.
| [in] | domain | Text domain. |
| [in] | msgid | Message id (including English translation). |