Manages the installed language packs and the one translations come from.
More...
Manages the installed language packs and the one translations come from.
A language pack is a file of system resources: a translation catalog and fonts. The catalog of the selected pack is given to Internationalization, and is given again whenever its file changes. Changing the language puts a PEBBLE_LANGUAGE_CHANGE_EVENT.
◆ language_pack_enable()
| void language_pack_enable |
( |
bool |
enable | ) |
|
Use or stop using the selected translation catalog.
- Parameters
-
| enable | true to translate with the catalog, false to fall back to English. |
◆ language_pack_get_info()
Read the metadata of an installed pack without changing the language.
- Parameters
-
| slot | Pack slot. |
| [out] | info | Metadata, with its strings zero-padded. |
- Returns
- true if the pack has a translation catalog.
◆ language_pack_has_fonts()
| bool language_pack_has_fonts |
( |
uint8_t |
slot | ) |
|
Check whether a pack carries at least one valid font, with or without a translation.
- Parameters
-
◆ language_pack_install_begin()
| const char * language_pack_install_begin |
( |
const char * |
filename | ) |
|
Resolve the file a PutBytes file transfer writes to.
Additive pack installs go to the first free pack slot; other files are unchanged.
- Parameters
-
| filename | Path of the file being transferred. |
- Returns
- Path to write, or NULL if every pack slot is occupied.
◆ language_pack_install_end()
| void language_pack_install_end |
( |
bool |
success | ) |
|
◆ language_pack_remove()
| bool language_pack_remove |
( |
uint8_t |
slot | ) |
|
Remove an installed pack, falling back to English if it was selected.
- Parameters
-
- Returns
- true if the pack was removed.
◆ language_pack_set_resource()
| void language_pack_set_resource |
( |
uint32_t |
resource_id | ) |
|
Select the system resource holding the translation catalog.
If the user chose English, the catalog is not used.
- Parameters
-
| resource_id | System resource ID of the catalog. |