fix locale initialization

This commit is contained in:
Enno Rehling 2017-02-09 23:28:50 +01:00
parent f48dd41538
commit b504899b07
5 changed files with 4 additions and 5 deletions

View File

@ -22,7 +22,6 @@
void config_reset(void) { void config_reset(void) {
default_locale = 0; default_locale = 0;
free_config(); free_config();
free_locales();
free_nrmesssages(); free_nrmesssages();
free_spells(); free_spells();
free_buildingtypes(); free_buildingtypes();
@ -37,7 +36,6 @@ int config_parse(const char *json)
if (conf) { if (conf) {
json_config(conf); json_config(conf);
cJSON_Delete(conf); cJSON_Delete(conf);
init_locales();
return 0; return 0;
} }
else { else {

View File

@ -517,7 +517,7 @@ static void reset_game(void)
for (f = factions; f; f = f->next) { for (f = factions; f; f = f->next) {
f->flags &= FFL_SAVEMASK; f->flags &= FFL_SAVEMASK;
} }
init_locales(); // init_locales();
} }
static int tolua_process_orders(lua_State * L) static int tolua_process_orders(lua_State * L)

View File

@ -203,7 +203,7 @@ param_t findparam(const char *s, const struct locale * lang)
void **tokens = get_translations(lang, UT_PARAMS); void **tokens = get_translations(lang, UT_PARAMS);
critbit_tree *cb = (critbit_tree *)*tokens; critbit_tree *cb = (critbit_tree *)*tokens;
if (!cb) { 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)) { else if (cb_find_prefix(cb, str, strlen(str), &match, 1, 0)) {
cb_get_kv(match, &i, sizeof(int)); cb_get_kv(match, &i, sizeof(int));

View File

@ -4196,6 +4196,7 @@ void init_processor(void)
void processorders(void) void processorders(void)
{ {
init_locales();
init_processor(); init_processor();
process(); process();
/*************************************************/ /*************************************************/

View File

@ -301,7 +301,7 @@ void init_translations(const struct locale *lang, int ut, const char * (*string_
add_translation(cb, key, i); add_translation(cb, key, i);
} }
else { 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);
} }
} }
} }