forked from github/server
superfluous semicolons and other small stuff.
missing strings are an error, not a warning.
This commit is contained in:
parent
e8ad542430
commit
f524f23cd4
|
@ -7,4 +7,3 @@ require 'tests.locale'
|
|||
require 'tests.regions'
|
||||
require 'tests.study'
|
||||
require 'tests.movement'
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@ module("tests.eressea.pool", package.seeall, lunit.testcase )
|
|||
|
||||
function setup()
|
||||
eressea.game.reset()
|
||||
eressea.config.reset();
|
||||
eressea.config.reset()
|
||||
eressea.settings.set("rules.economy.food", "0")
|
||||
eressea.settings.set("nmr.removenewbie", "0")
|
||||
eressea.settings.set("nmr.timeout", "0")
|
||||
|
|
|
@ -155,7 +155,7 @@ static void json_construction(cJSON *json, construction **consp) {
|
|||
return;
|
||||
}
|
||||
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;
|
||||
}
|
||||
construction * cons = (construction *)calloc(sizeof(construction), 1);
|
||||
|
@ -178,7 +178,7 @@ static void json_construction(cJSON *json, construction **consp) {
|
|||
}
|
||||
break;
|
||||
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;
|
||||
|
|
|
@ -147,16 +147,15 @@ const char *locale_string(const locale * lang, const char *key)
|
|||
}
|
||||
find = find->nexthash;
|
||||
}
|
||||
if (!find) {
|
||||
log_warning("missing translation for \"%s\" in locale %s\n", key, lang->name);
|
||||
if (find) {
|
||||
return find->str;
|
||||
}
|
||||
log_error("missing translation for \"%s\" in locale %s\n", key, lang->name);
|
||||
if (lang->fallback) {
|
||||
return locale_string(lang->fallback, key);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
return find->str;
|
||||
}
|
||||
return 0;
|
||||
return key;
|
||||
}
|
||||
|
||||
void locale_setstring(locale * lang, const char *key, const char *value)
|
||||
|
|
Loading…
Reference in New Issue