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.regions'
|
||||||
require 'tests.study'
|
require 'tests.study'
|
||||||
require 'tests.movement'
|
require 'tests.movement'
|
||||||
|
|
||||||
|
|
|
@ -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")
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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;
|
||||||
if (lang->fallback) {
|
}
|
||||||
return locale_string(lang->fallback, key);
|
log_error("missing translation for \"%s\" in locale %s\n", key, lang->name);
|
||||||
}
|
if (lang->fallback) {
|
||||||
return 0;
|
return locale_string(lang->fallback, key);
|
||||||
}
|
}
|
||||||
return find->str;
|
|
||||||
}
|
}
|
||||||
return 0;
|
return key;
|
||||||
}
|
}
|
||||||
|
|
||||||
void locale_setstring(locale * lang, const char *key, const char *value)
|
void locale_setstring(locale * lang, const char *key, const char *value)
|
||||||
|
|
Loading…
Reference in New Issue