mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +02:00
Minor refactoring of translations:
- removed unsuccessful and broken validation of translations - pass JsonNode when registering strings to provide information on mod source
This commit is contained in:
@@ -28,7 +28,7 @@ void CBankInstanceConstructor::initTypeData(const JsonNode & input)
|
||||
if (input.Struct().count("name") == 0)
|
||||
logMod->warn("Bank %s missing name!", getJsonKey());
|
||||
|
||||
VLC->generaltexth->registerString(input.getModScope(), getNameTextID(), input["name"].String());
|
||||
VLC->generaltexth->registerString(input.getModScope(), getNameTextID(), input["name"]);
|
||||
|
||||
levels = input["levels"].Vector();
|
||||
bankResetDuration = static_cast<si32>(input["resetDuration"].Float());
|
||||
|
||||
@@ -278,7 +278,7 @@ std::unique_ptr<ObjectClass> CObjectClassesHandler::loadFromJson(const std::stri
|
||||
newObject->base = json["base"];
|
||||
newObject->id = index;
|
||||
|
||||
VLC->generaltexth->registerString(scope, newObject->getNameTextID(), json["name"].String());
|
||||
VLC->generaltexth->registerString(scope, newObject->getNameTextID(), json["name"]);
|
||||
|
||||
newObject->objectTypeHandlers.resize(json["lastReservedIndex"].Float() + 1);
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ void CRewardableConstructor::initTypeData(const JsonNode & config)
|
||||
blockVisit = config["blockedVisitable"].Bool();
|
||||
|
||||
if (!config["name"].isNull())
|
||||
VLC->generaltexth->registerString( config.getModScope(), getNameTextID(), config["name"].String());
|
||||
VLC->generaltexth->registerString( config.getModScope(), getNameTextID(), config["name"]);
|
||||
|
||||
JsonUtils::validate(config, "vcmi:rewardable", getJsonKey());
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ void DwellingInstanceConstructor::initTypeData(const JsonNode & input)
|
||||
if (input.Struct().count("name") == 0)
|
||||
logMod->warn("Dwelling %s missing name!", getJsonKey());
|
||||
|
||||
VLC->generaltexth->registerString( input.getModScope(), getNameTextID(), input["name"].String());
|
||||
VLC->generaltexth->registerString( input.getModScope(), getNameTextID(), input["name"]);
|
||||
|
||||
const JsonVector & levels = input["creatures"].Vector();
|
||||
const auto totalLevels = levels.size();
|
||||
|
||||
Reference in New Issue
Block a user