1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-06 09:09:40 +02:00

Added option to skip validation of mods

This commit is contained in:
Ivan Savenko
2023-03-07 00:06:22 +02:00
parent db9a296d02
commit 58cfea02f1
3 changed files with 10 additions and 0 deletions

View File

@@ -8,6 +8,7 @@
"author" : "VCMI-Team", "author" : "VCMI-Team",
"modType" : "Grafik", "modType" : "Grafik",
"skipValidation" : true,
"translations" : [ "translations" : [
"config/vcmi/german.json" "config/vcmi/german.json"
] ]
@@ -19,6 +20,7 @@
"author" : "Zespół VCMI", "author" : "Zespół VCMI",
"modType" : "Graficzny", "modType" : "Graficzny",
"skipValidation" : true,
"translations" : [ "translations" : [
"config/vcmi/polish.json" "config/vcmi/polish.json"
] ]
@@ -30,6 +32,7 @@
"author" : "Команда VCMI", "author" : "Команда VCMI",
"modType" : "Графический", "modType" : "Графический",
"skipValidation" : true,
"translations" : [ "translations" : [
"config/vcmi/russian.json" "config/vcmi/russian.json"
] ]

View File

@@ -26,6 +26,10 @@
"type":"string", "type":"string",
"description": "Author of the mod. Can be nickname, real name or name of team" "description": "Author of the mod. Can be nickname, real name or name of team"
}, },
"skipValidation" : {
"type":"boolean",
"description": "If set to true, vcmi will skip validation of current translation json files"
},
"translations":{ "translations":{
"type":"array", "type":"array",
"description": "List of files with translations for this language", "description": "List of files with translations for this language",

View File

@@ -1156,6 +1156,9 @@ bool CModHandler::validateTranslations(TModID modName) const
if (mod.config[language.identifier].isNull()) if (mod.config[language.identifier].isNull())
continue; continue;
if (mod.config[language.identifier]["skipValidation"].Bool())
continue;
auto fileList = mod.config[language.identifier]["translations"].convertTo<std::vector<std::string> >(); auto fileList = mod.config[language.identifier]["translations"].convertTo<std::vector<std::string> >();
JsonNode json = JsonUtils::assembleFromFiles(fileList); JsonNode json = JsonUtils::assembleFromFiles(fileList);
result |= VLC->generaltexth->validateTranslation(language.identifier, modName, json); result |= VLC->generaltexth->validateTranslation(language.identifier, modName, json);