jsonconf should not need to create locales

This commit is contained in:
Enno Rehling 2017-02-12 06:06:33 +01:00
parent 17ff2ead41
commit 6893248473
2 changed files with 6 additions and 5 deletions

View File

@ -654,7 +654,7 @@ static void json_strings(cJSON *json) {
} }
for (child = json->child; child; child = child->next) { for (child = json->child; child; child = child->next) {
if (child->type == cJSON_Object) { if (child->type == cJSON_Object) {
struct locale *lang = get_or_create_locale(child->string); struct locale *lang = get_locale(child->string);
json_locale(child, lang); json_locale(child, lang);
} }
else { else {
@ -695,7 +695,7 @@ static void json_directions(cJSON *json) {
return; return;
} }
for (child = json->child; child; child = child->next) { for (child = json->child; child; child = child->next) {
struct locale * lang = get_or_create_locale(child->string); struct locale * lang = get_locale(child->string);
json_direction(child, lang); json_direction(child, lang);
} }
} }
@ -771,7 +771,7 @@ static void json_skills(cJSON *json) {
return; return;
} }
for (child = json->child; child; child = child->next) { for (child = json->child; child; child = child->next) {
struct locale * lang = get_or_create_locale(child->string); struct locale * lang = get_locale(child->string);
json_skill(child, lang); json_skill(child, lang);
} }
} }
@ -783,7 +783,7 @@ static void json_keywords(cJSON *json) {
return; return;
} }
for (child = json->child; child; child = child->next) { for (child = json->child; child; child = child->next) {
struct locale * lang = get_or_create_locale(child->string); struct locale * lang = get_locale(child->string);
json_keyword(child, lang); json_keyword(child, lang);
} }
} }

View File

@ -600,9 +600,10 @@ static void test_infinitive_from_config(CuTest *tc) {
cJSON *json = cJSON_Parse(data); cJSON *json = cJSON_Parse(data);
CuAssertPtrNotNull(tc, json); CuAssertPtrNotNull(tc, json);
test_setup();
lang = get_or_create_locale("de");
json_config(json); json_config(json);
lang = get_or_create_locale("de");
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERN", lang)); CuAssertIntEquals(tc, K_STUDY, get_keyword("LERN", lang));
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNE", lang)); CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNE", lang));
CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNEN", lang)); CuAssertIntEquals(tc, K_STUDY, get_keyword("LERNEN", lang));