Skip to content

Commit

Permalink
Fix some CLocConstStrings being localized twice
Browse files Browse the repository at this point in the history
Column and key names are stored as `CLocConstString`s, which automatically return the localized string with the operator `const char *()`. Calling `Localize` manually for these is unnecessary.
  • Loading branch information
Robyt3 committed Aug 29, 2023
1 parent e3700ac commit 0114e03
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/game/client/components/menus_browser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ void CMenus::RenderServerbrowserServerList(CUIRect View)
if(PlayersOrPing && g_Config.m_BrSortOrder == 2 && (s_aCols[i].m_Sort == IServerBrowser::SORT_NUMPLAYERS || s_aCols[i].m_Sort == IServerBrowser::SORT_PING))
Checked = 2;

if(DoButton_GridHeader(s_aCols[i].m_Caption, Localize(s_aCols[i].m_Caption), Checked, &s_aCols[i].m_Rect))
if(DoButton_GridHeader(s_aCols[i].m_Caption, s_aCols[i].m_Caption, Checked, &s_aCols[i].m_Rect))
{
if(s_aCols[i].m_Sort != -1)
{
Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/menus_ingame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1022,7 +1022,7 @@ void CMenus::RenderGhost(CUIRect MainView)

// do headers
for(int i = 0; i < NumCols; i++)
DoButton_GridHeader(s_aCols[i].m_Caption, Localize(s_aCols[i].m_Caption), 0, &s_aCols[i].m_Rect);
DoButton_GridHeader(s_aCols[i].m_Caption, s_aCols[i].m_Caption, 0, &s_aCols[i].m_Rect);

View.Draw(ColorRGBA(0, 0, 0, 0.15f), 0, 0);

Expand Down
2 changes: 1 addition & 1 deletion src/game/client/components/menus_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1009,7 +1009,7 @@ void CMenus::DoSettingsControlsButtons(int Start, int Stop, CUIRect View)
Button.VSplitLeft(135.0f, &Label, &Button);

char aBuf[64];
str_format(aBuf, sizeof(aBuf), "%s:", Localize((const char *)Key.m_Name));
str_format(aBuf, sizeof(aBuf), "%s:", (const char *)Key.m_Name);

UI()->DoLabel(&Label, aBuf, 13.0f, TEXTALIGN_ML);
int OldId = Key.m_KeyId, OldModifierCombination = Key.m_ModifierCombination, NewModifierCombination;
Expand Down

0 comments on commit 0114e03

Please sign in to comment.