Selaa lähdekoodia

Update accurate shot translation handling

Co-authored-by: Ivan Savenko <[email protected]>
Dydzio 1 vuosi sitten
vanhempi
sitoutus
250b1b69a8
1 muutettua tiedostoa jossa 5 lisäystä ja 11 poistoa
  1. 5 11
      lib/spells/effects/Damage.cpp

+ 5 - 11
lib/spells/effects/Damage.cpp

@@ -155,17 +155,11 @@ void Damage::describeEffect(std::vector<MetaString> & log, const Mechanics * m,
 	else if(m->getSpell()->getJsonKey().find("accurateShot") != std::string::npos && !multiple)
 	{
 		MetaString line;
-		if(kills > 1)
-		{
-			line.appendTextID("vcmi.battleWindow.accurateShot.resultDescription"); //(number) (unit type) was killed with an accurate shot!
-			line.replaceNumber(kills);
-			firstTarget->addNameReplacement(line, true);
-		}
-		else
-		{
-			line.appendTextID("vcmi.battleWindow.accurateShot.resultDescription.1"); //1 (unit type) were killed by accurate shots!
-			firstTarget->addNameReplacement(line, false);
-		}
+		std::string preferredLanguage = VLC->generaltexth->getPreferredLanguage();
+		std::string textID = "vcmi.battleWindow.accurateShot.resultDescription";
+		line.appendTextID(Languages::getPluralFormTextID( preferredLanguage, kills, text));
+		line.replaceNumber(kills);
+		firstTarget->addNameReplacement(line, true);
 		log.push_back(line);
 	}
 	else if(m->getSpellIndex() == SpellID::THUNDERBOLT && !multiple)