diff options
author | Jo-Philipp Wich <jo@mein.io> | 2018-10-17 12:57:34 +0200 |
---|---|---|
committer | Jo-Philipp Wich <jo@mein.io> | 2018-11-05 11:01:45 +0100 |
commit | 62102f4f0e8a88ffbdf44517f4ff737049a3f3bf (patch) | |
tree | 014bf7a3f47798a05bcdede54da8779f7a4e8491 /modules/luci-base/src/template_lmo.h | |
parent | 4623a58394b1cc71ddf24865a2f0639ee2119470 (diff) |
luci-base: template: add translation iterator function
Introduce a new luci.template.parser.get_translations() function which will
iterate all loaded translation entries and pass the to the given callback
function.
This is useful to expose the loaded translations in other formats, e.g. for
wrapping them into JSON feeds.
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'modules/luci-base/src/template_lmo.h')
-rw-r--r-- | modules/luci-base/src/template_lmo.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/modules/luci-base/src/template_lmo.h b/modules/luci-base/src/template_lmo.h index f251c63ddd..587884ea3a 100644 --- a/modules/luci-base/src/template_lmo.h +++ b/modules/luci-base/src/template_lmo.h @@ -73,6 +73,7 @@ struct lmo_catalog { typedef struct lmo_catalog lmo_catalog_t; +typedef void (*lmo_iterate_cb_t)(uint32_t, const char *, int, void *); uint32_t sfh_hash(const char *data, int len); uint32_t lmo_canon_hash(const char *data, int len); @@ -87,6 +88,7 @@ extern lmo_catalog_t *_lmo_active_catalog; int lmo_load_catalog(const char *lang, const char *dir); int lmo_change_catalog(const char *lang); int lmo_translate(const char *key, int keylen, char **out, int *outlen); +void lmo_iterate(lmo_iterate_cb_t cb, void *priv); void lmo_close_catalog(const char *lang); #endif |