diff options
Diffstat (limited to 'src/l10n.c')
| -rw-r--r-- | src/l10n.c | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -247,6 +247,23 @@ const LocaleMeta *beaker_get_locale_meta(const char *locale_id) { return NULL; } +const char *beaker_get_locale_value(const char *locale_id, const char *key) { + if (locale_id == NULL || key == NULL) { + return NULL; + } + for (int i = 0; i < locale_count; i++) { + if (strcmp(locales[i].meta.id, locale_id) == 0) { + for (int j = 0; j < locales[i].key_count; j++) { + if (strcmp(locales[i].keys[j].key, key) == 0) { + return locales[i].keys[j].value; + } + } + return NULL; + } + } + return NULL; +} + void beaker_free_locales(void) { for (int i = 0; i < locale_count; i++) { free(locales[i].keys); |
