1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +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",
"modType" : "Grafik",
"skipValidation" : true,
"translations" : [
"config/vcmi/german.json"
]
@ -19,6 +20,7 @@
"author" : "Zespół VCMI",
"modType" : "Graficzny",
"skipValidation" : true,
"translations" : [
"config/vcmi/polish.json"
]
@ -30,6 +32,7 @@
"author" : "Команда VCMI",
"modType" : "Графический",
"skipValidation" : true,
"translations" : [
"config/vcmi/russian.json"
]

View File

@ -26,6 +26,10 @@
"type":"string",
"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":{
"type":"array",
"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())
continue;
if (mod.config[language.identifier]["skipValidation"].Bool())
continue;
auto fileList = mod.config[language.identifier]["translations"].convertTo<std::vector<std::string> >();
JsonNode json = JsonUtils::assembleFromFiles(fileList);
result |= VLC->generaltexth->validateTranslation(language.identifier, modName, json);