瀏覽代碼

Added option to skip validation of mods

Ivan Savenko 2 年之前
父節點
當前提交
58cfea02f1
共有 3 個文件被更改,包括 10 次插入0 次删除
  1. 3 0
      Mods/vcmi/mod.json
  2. 4 0
      config/schemas/mod.json
  3. 3 0
      lib/CModHandler.cpp

+ 3 - 0
Mods/vcmi/mod.json

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

+ 4 - 0
config/schemas/mod.json

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

+ 3 - 0
lib/CModHandler.cpp

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