superfluous semicolons and other small stuff.

missing strings are an error, not a warning.
This commit is contained in:
Enno Rehling 2014-12-31 13:17:54 +01:00
parent e8ad542430
commit f524f23cd4
4 changed files with 10 additions and 12 deletions

View File

@ -7,4 +7,3 @@ require 'tests.locale'
require 'tests.regions' require 'tests.regions'
require 'tests.study' require 'tests.study'
require 'tests.movement' require 'tests.movement'

View File

@ -4,7 +4,7 @@ module("tests.eressea.pool", package.seeall, lunit.testcase )
function setup() function setup()
eressea.game.reset() eressea.game.reset()
eressea.config.reset(); eressea.config.reset()
eressea.settings.set("rules.economy.food", "0") eressea.settings.set("rules.economy.food", "0")
eressea.settings.set("nmr.removenewbie", "0") eressea.settings.set("nmr.removenewbie", "0")
eressea.settings.set("nmr.timeout", "0") eressea.settings.set("nmr.timeout", "0")

View File

@ -155,7 +155,7 @@ static void json_construction(cJSON *json, construction **consp) {
return; return;
} }
if (json->type != cJSON_Object) { if (json->type != cJSON_Object) {
log_error("building %s is not a json object: %d", json->string, json->type); log_error("construction %s is not a json object: %d", json->string, json->type);
return; return;
} }
construction * cons = (construction *)calloc(sizeof(construction), 1); construction * cons = (construction *)calloc(sizeof(construction), 1);
@ -178,7 +178,7 @@ static void json_construction(cJSON *json, construction **consp) {
} }
break; break;
default: default:
log_error("building %s contains unknown attribute %s", json->string, child->string); log_error("construction %s contains unknown attribute %s", json->string, child->string);
} }
} }
*consp = cons; *consp = cons;

View File

@ -147,16 +147,15 @@ const char *locale_string(const locale * lang, const char *key)
} }
find = find->nexthash; find = find->nexthash;
} }
if (!find) { if (find) {
log_warning("missing translation for \"%s\" in locale %s\n", key, lang->name); return find->str;
}
log_error("missing translation for \"%s\" in locale %s\n", key, lang->name);
if (lang->fallback) { if (lang->fallback) {
return locale_string(lang->fallback, key); return locale_string(lang->fallback, key);
} }
return 0;
} }
return find->str; return key;
}
return 0;
} }
void locale_setstring(locale * lang, const char *key, const char *value) void locale_setstring(locale * lang, const char *key, const char *value)