-make gettext compatible
This commit is contained in:
parent
6d099b44fb
commit
8a8cb1d2f9
@ -80,7 +80,9 @@ TALER_JSON_check_i18n (const json_t *i18n)
|
|||||||
if (! json_is_string (member))
|
if (! json_is_string (member))
|
||||||
return false;
|
return false;
|
||||||
/* Field name must be either of format "en_UK"
|
/* 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))
|
switch (strlen (field))
|
||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
@ -107,6 +109,20 @@ TALER_JSON_check_i18n (const json_t *i18n)
|
|||||||
if (! isalpha (field[4]))
|
if (! isalpha (field[4]))
|
||||||
return false;
|
return false;
|
||||||
break;
|
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:
|
default:
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user