diff --git a/clibs b/clibs index 27c8b3202..f91ef37f0 160000 --- a/clibs +++ b/clibs @@ -1 +1 @@ -Subproject commit 27c8b3202b52766465743c3324fc0b52c5ba4b11 +Subproject commit f91ef37f08c5244bf616f1836c0aa9caaf36805c diff --git a/src/kernel/xmlreader.c b/src/kernel/xmlreader.c index d89259317..5ce6800ef 100644 --- a/src/kernel/xmlreader.c +++ b/src/kernel/xmlreader.c @@ -66,10 +66,6 @@ static void xml_readtext(xmlNodePtr node, struct locale **lang, xmlChar ** text) xmlChar *propValue = xmlGetProp(node, BAD_CAST "locale"); assert(propValue != NULL); *lang = get_locale((const char *)propValue); -#ifdef MAKE_LOCALES - if (*lang == NULL) - *lang = get_or_create_locale((const char *)propValue); -#endif xmlFree(propValue); *text = xmlNodeListGetString(node->doc, node->children, 1); diff --git a/src/main.c b/src/main.c index a3bcdb866..875a33bf9 100644 --- a/src/main.c +++ b/src/main.c @@ -70,15 +70,13 @@ static void load_inifile(dictionary * d) lomem = iniparser_getint(d, "game:lomem", lomem) ? 1 : 0; verbosity = iniparser_getint(d, "game:verbose", 2); - str = iniparser_getstring(d, "game:locales", "de,en"); - make_locales(str); } static dictionary *parse_config(const char *filename) { char path[MAX_PATH]; dictionary *d; - const char *cfgpath = config_get("config.path"); + const char *str, *cfgpath = config_get("config.path"); if (cfgpath) { join_path(cfgpath, filename, path, sizeof(path)); @@ -99,6 +97,8 @@ static dictionary *parse_config(const char *filename) gm_codepage = iniparser_getint(d, "editor:codepage", gm_codepage); #endif } + str = config_get("game.locales"); + make_locales(str ? str : "de,en"); return d; } diff --git a/src/util/language.c b/src/util/language.c index 86a6895be..3f628036d 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -327,10 +327,10 @@ static int locale_init = 0; void init_locales(void) { - int l; + locale * lang; if (locale_init) return; - for (l = 0; localenames[l]; ++l) { - struct locale *lang = get_or_create_locale(localenames[l]); + assert(locales); + for (lang = locales; lang; lang = lang->next) { init_locale(lang); } locale_init = 1;