Skip to content

Commit

Permalink
Fix Translation issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
yavl committed Jun 9, 2019
1 parent 5df6cc0 commit a4b37c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
5 changes: 1 addition & 4 deletions src/infcroya/croyaplayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -482,8 +482,5 @@ void CroyaPlayer::SetClass(IClass* pClass, bool DrawPurpleThing)

char aBuf[256];
str_format(aBuf, sizeof(aBuf), "%s", m_pClass->GetName().c_str());
if (str_comp(GetLanguage(), "english") == 0)
m_pGameServer->SendBroadcast(aBuf, m_pPlayer->GetCID());
else
m_pGameServer->SendBroadcast(Localize(aBuf, GetLanguage()), m_pPlayer->GetCID());
m_pGameServer->SendBroadcast(Localize(aBuf, GetLanguage()), m_pPlayer->GetCID());
}
3 changes: 3 additions & 0 deletions src/infcroya/localization/localization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@

const char *Localize(const char *pStr, const char *pContext)
{
if (str_comp_nocase(pContext, "english") == 0) {
return pStr;
}
const char *pNewStr = g_Localization.FindString(str_quickhash(pStr), str_quickhash(pContext));
return pNewStr ? pNewStr : pStr;
}
Expand Down

0 comments on commit a4b37c3

Please sign in to comment.