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.study'
require 'tests.movement'

View File

@ -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")

View File

@ -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;

View File

@ -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 (lang->fallback) {
return locale_string(lang->fallback, key);
}
return 0;
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 find->str;
}
return 0;
return key;
}
void locale_setstring(locale * lang, const char *key, const char *value)