diff options
author | Christian Grothoff <christian@grothoff.org> | 2021-08-04 18:34:25 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2021-08-04 18:34:25 +0200 |
commit | 8a8cb1d2f988f31325226ed94a0f805eaa47c9ab (patch) | |
tree | 28d13691603ee5265d9ad746a40c20ea835cb1c6 /src | |
parent | 6d099b44fbf31f6070d73ee1b136271428a559aa (diff) |
-make gettext compatible
Diffstat (limited to 'src')
-rw-r--r-- | src/json/i18n.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/json/i18n.c b/src/json/i18n.c index 1d3076e2d..f927a71e1 100644 --- a/src/json/i18n.c +++ b/src/json/i18n.c @@ -80,7 +80,9 @@ TALER_JSON_check_i18n (const json_t *i18n) if (! json_is_string (member)) return false; /* Field name must be either of format "en_UK" - or just "en"; we do not care about capitalization */ + or just "en"; we do not care about capitalization; + for syntax, see GNU Gettext manual, including + appendix A for rare language codes. */ switch (strlen (field)) { case 0: @@ -107,6 +109,20 @@ TALER_JSON_check_i18n (const json_t *i18n) if (! isalpha (field[4])) return false; break; + case 6: + if (! isalpha (field[0])) + return false; + if (! isalpha (field[1])) + return false; + if ('_' != field[2]) + return false; + if (! isalpha (field[3])) + return false; + if (! isalpha (field[4])) + return false; + if (! isalpha (field[5])) + return false; + break; default: return false; } |