From b504899b07fbcc48f9c96cec85da3c2e4d066561 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Thu, 9 Feb 2017 23:28:50 +0100 Subject: [PATCH] fix locale initialization --- src/bind_config.c | 2 -- src/bindings.c | 2 +- src/kernel/config.c | 2 +- src/laws.c | 1 + src/util/language.c | 2 +- 5 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/bind_config.c b/src/bind_config.c index faf543f47..c603800ed 100644 --- a/src/bind_config.c +++ b/src/bind_config.c @@ -22,7 +22,6 @@ void config_reset(void) { default_locale = 0; free_config(); - free_locales(); free_nrmesssages(); free_spells(); free_buildingtypes(); @@ -37,7 +36,6 @@ int config_parse(const char *json) if (conf) { json_config(conf); cJSON_Delete(conf); - init_locales(); return 0; } else { diff --git a/src/bindings.c b/src/bindings.c index 7bf30202a..1515c74e0 100755 --- a/src/bindings.c +++ b/src/bindings.c @@ -517,7 +517,7 @@ static void reset_game(void) for (f = factions; f; f = f->next) { f->flags &= FFL_SAVEMASK; } - init_locales(); +// init_locales(); } static int tolua_process_orders(lua_State * L) diff --git a/src/kernel/config.c b/src/kernel/config.c index b2734d43a..ca23a5bc9 100644 --- a/src/kernel/config.c +++ b/src/kernel/config.c @@ -203,7 +203,7 @@ param_t findparam(const char *s, const struct locale * lang) void **tokens = get_translations(lang, UT_PARAMS); critbit_tree *cb = (critbit_tree *)*tokens; if (!cb) { - log_error("no parameters defined in locale %s", locale_name(lang)); + log_warning("no parameters defined in locale %s", locale_name(lang)); } else if (cb_find_prefix(cb, str, strlen(str), &match, 1, 0)) { cb_get_kv(match, &i, sizeof(int)); diff --git a/src/laws.c b/src/laws.c index 98ff5d9f6..78ca6fba9 100644 --- a/src/laws.c +++ b/src/laws.c @@ -4196,6 +4196,7 @@ void init_processor(void) void processorders(void) { + init_locales(); init_processor(); process(); /*************************************************/ diff --git a/src/util/language.c b/src/util/language.c index 0de04be71..86a6895be 100644 --- a/src/util/language.c +++ b/src/util/language.c @@ -301,7 +301,7 @@ void init_translations(const struct locale *lang, int ut, const char * (*string_ add_translation(cb, key, i); } else { - log_error("no translation for %s in locale %s", s, lang->name); + log_warning("no translation for %s in locale %s", s, lang->name); } } }