PebbleOS v4.47.0-512-g5285d4236
Loading...
Searching...
No Matches
i18n.h File Reference
#include <stddef.h>
#include <stdint.h>

Data Structures

struct  pbl_i18n_catalog_info
 Metadata of a catalog. More...
 
struct  pbl_i18n_catalog
 Catalog of translations, a gettext MO file. More...
 

Macros

#define PBL_I18N_LOCALE_LEN   6
 Size of an ISO locale string such as "en_US", including the terminator.
 
#define PBL_I18N_NAME_LEN   30
 Size of a language name buffer, including the terminator.
 
#define pbl_i18n_noop(string)   (string)
 Tag a string for extraction without translating it.
 
#define pbl_i18n_ctx_noop(ctx, string)   (ctx "\4" string)
 Tag a string with a context for extraction without translating it.
 
#define pbl_i18n_ctx_get(ctx, string, owner)   pbl_i18n_get(pbl_i18n_ctx_noop(ctx, string), owner)
 pbl_i18n_get() with a context.
 
#define pbl_i18n_ctx_get_with_buffer(ctx, string, buffer, length)    pbl_i18n_get_with_buffer(pbl_i18n_ctx_noop(ctx, string), buffer, length)
 pbl_i18n_get_with_buffer() with a context.
 
#define pbl_i18n_ctx_get_length(ctx, string)   pbl_i18n_get_length(pbl_i18n_ctx_noop(ctx, string))
 pbl_i18n_get_length() with a context.
 
#define pbl_i18n_ctx_free(ctx, string, owner)   pbl_i18n_free(pbl_i18n_ctx_noop(ctx, string), owner)
 pbl_i18n_free() with a context.
 

Functions

int pbl_i18n_set_catalog (const struct pbl_i18n_catalog *catalog)
 Set the catalog translations come from.
 
int pbl_i18n_catalog_get_info (const struct pbl_i18n_catalog *catalog, struct pbl_i18n_catalog_info *info)
 Read the metadata of a catalog without setting it.
 
const char * pbl_i18n_get (const char *string, const void *owner)
 Translate a string, caching the result for an owner.
 
void pbl_i18n_get_with_buffer (const char *string, char *buffer, size_t length)
 Translate a string into a buffer.
 
size_t pbl_i18n_get_length (const char *string)
 Get the length of a translated string.
 
void pbl_i18n_free (const char *string, const void *owner)
 Free a cached translation.
 
void pbl_i18n_free_all (const void *owner)
 Free all cached translations of an owner.
 
char * pbl_i18n_get_locale (void)
 Get the ISO locale of the catalog.
 
uint16_t pbl_i18n_get_version (void)
 Get the version of the catalog.
 
char * pbl_i18n_get_lang_name (void)
 Get the language name of the catalog.