CDC Badge OS
Firmware for the CDC Badge v1.0 hardware security key
Loading...
Searching...
No Matches
I18n

Look up translated strings. More...

Macros

#define HOST_LANG_EN   0
#define HOST_LANG_DE   1

Functions

int host_i18n_tr_key (const char *key, char *out, uint32_t out_cap)
 Translate a plugin-local key into the current language.
int host_i18n_tr_meta (const char *field, char *out, uint32_t out_cap)
 Read a metadata field (name, description, ...) from the plugin manifest.
int host_i18n_tr_core (const char *key, char *out, uint32_t out_cap)
 Translate a core.* key from the firmware string table.
uint8_t host_i18n_current_language (void)
 Active language code (HOST_LANG_*).

Detailed Description

Look up translated strings.

Plugins ship per-language tables in their manifest; host_i18n_tr_key resolves keys against the plugin table, and host_i18n_tr_core resolves against the firmware's core string table.

Macro Definition Documentation

◆ HOST_LANG_DE

#define HOST_LANG_DE   1

Definition at line 1178 of file host_api.h.

◆ HOST_LANG_EN

#define HOST_LANG_EN   0

Definition at line 1177 of file host_api.h.

Function Documentation

◆ host_i18n_current_language()

uint8_t host_i18n_current_language ( void )

Active language code (HOST_LANG_*).

Definition at line 101 of file host_api_i18n.cpp.

Referenced by cdc::plugin_manager::w_host_i18n_current_language().

◆ host_i18n_tr_core()

int host_i18n_tr_core ( const char * key,
char * out,
uint32_t out_cap )

Translate a core.* key from the firmware string table.

Definition at line 106 of file host_api_i18n.cpp.

References cdc::ui::I18n::instance().

Referenced by cdc::plugin_manager::w_host_i18n_tr_core().

◆ host_i18n_tr_key()

int host_i18n_tr_key ( const char * key,
char * out,
uint32_t out_cap )

Translate a plugin-local key into the current language.

Parameters
out_capCapacity of out; the result is NUL-terminated.

Definition at line 68 of file host_api_i18n.cpp.

Referenced by cdc::plugin_manager::w_host_i18n_tr_key().

◆ host_i18n_tr_meta()

int host_i18n_tr_meta ( const char * field,
char * out,
uint32_t out_cap )

Read a metadata field (name, description, ...) from the plugin manifest.

Definition at line 79 of file host_api_i18n.cpp.

References LOG_W.

Referenced by cdc::plugin_manager::w_host_i18n_tr_meta().