瀏覽代碼

Fixed incorrect error messages from translations

Ivan Savenko 2 年之前
父節點
當前提交
06e5d37fbd
共有 3 個文件被更改,包括 9 次插入6 次删除
  1. 5 2
      lib/CGeneralTextHandler.cpp
  2. 1 1
      lib/mapObjects/CGHeroInstance.cpp
  3. 3 3
      lib/mapping/MapFormatH3M.cpp

+ 5 - 2
lib/CGeneralTextHandler.cpp

@@ -311,10 +311,13 @@ bool CGeneralTextHandler::validateTranslation(const std::string & language, cons
 	for (auto const & string : stringsLocalizations)
 	{
 		if (string.second.modContext != modContext)
-			continue;
+			continue; // Not our mod
+
+		if (string.second.baseLanguage.empty())
+			continue; // No base string
 
 		if (string.second.baseLanguage == language && !string.second.baseValue.empty())
-			continue;
+			continue; // Base string already uses our language
 
 		if (config.Struct().count(string.first) > 0)
 			continue;

+ 1 - 1
lib/mapObjects/CGHeroInstance.cpp

@@ -970,7 +970,7 @@ void CGHeroInstance::initExp(CRandomGenerator & rand)
 
 std::string CGHeroInstance::nodeName() const
 {
-	return "Hero " + getNameTranslated();
+	return "Hero " + getNameTextID();
 }
 
 std::string CGHeroInstance::getNameTranslated() const

+ 3 - 3
lib/mapping/MapFormatH3M.cpp

@@ -1449,11 +1449,11 @@ void CMapLoaderH3M::readObjects()
 				if(htid == 0xff)
 				{
 					hp->power = reader->readUInt8();
-					logGlobal->info("Hero placeholder: by power at %s", objPos.toString());
+					logGlobal->debug("Hero placeholder: by power at %s", objPos.toString());
 				}
 				else
 				{
-					logGlobal->info("Hero placeholder: %s at %s", VLC->heroh->objects[htid]->getNameTranslated(), objPos.toString());
+					logGlobal->debug("Hero placeholder: %s at %s", VLC->heroh->objects[htid]->getNameTranslated(), objPos.toString());
 					hp->power = 0;
 				}
 
@@ -1705,7 +1705,7 @@ CGObjectInstance * CMapLoaderH3M::readHero(const ObjectInstanceID & idToBeGiven,
 		if(!nhi->spells.empty())
 		{
 			nhi->clear();
-			logGlobal->warn("Hero %s subID=%d has spells set twice (in map properties and on adventure map instance). Using the latter set...", nhi->getNameTranslated(), nhi->subID);
+			logGlobal->warn("Hero %s subID=%d has spells set twice (in map properties and on adventure map instance). Using the latter set...", nhi->getNameTextID(), nhi->subID);
 		}
 
 		if(hasCustomSpells)