1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Merge pull request #3736 from IvanSavenko/fix_server_translations

Do not translate strings on server side
This commit is contained in:
Ivan Savenko
2024-04-10 19:12:34 +03:00
committed by GitHub
29 changed files with 175 additions and 207 deletions

View File

@ -388,7 +388,7 @@ void CGameHandler::giveExperience(const CGHeroInstance * hero, TExpType amountTo
InfoWindow iw;
iw.player = hero->tempOwner;
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 1); //can gain no more XP
iw.text.replaceRawString(hero->getNameTranslated());
iw.text.replaceTextID(hero->getNameTextID());
sendAndApply(&iw);
}
@ -1597,7 +1597,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
iw.components.emplace_back(ComponentType::SEC_SKILL, scholarSkill, scholarSkillLevel);
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 139);//"%s, who has studied magic extensively,
iw.text.replaceRawString(h1->getNameTranslated());
iw.text.replaceTextID(h1->getNameTextID());
if (!cs2.spells.empty())//if found new spell - apply
{
@ -1618,7 +1618,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
}
}
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 142);//from %s
iw.text.replaceRawString(h2->getNameTranslated());
iw.text.replaceTextID(h2->getNameTextID());
sendAndApply(&cs2);
}
@ -1646,7 +1646,7 @@ void CGameHandler::useScholarSkill(ObjectInstanceID fromHero, ObjectInstanceID t
}
}
iw.text.appendLocalString(EMetaText::GENERAL_TXT, 148);//from %s
iw.text.replaceRawString(h2->getNameTranslated());
iw.text.replaceTextID(h2->getNameTextID());
sendAndApply(&cs1);
}
sendAndApply(&iw);
@ -4269,14 +4269,6 @@ void CGameHandler::showInfoDialog(InfoWindow * iw)
sendAndApply(iw);
}
void CGameHandler::showInfoDialog(const std::string & msg, PlayerColor player)
{
InfoWindow iw;
iw.player = player;
iw.text.appendRawString(msg);
showInfoDialog(&iw);
}
CRandomGenerator & CGameHandler::getRandomGenerator()
{
return CRandomGenerator::getDefault();