Skip to content

Commit

Permalink
Fix compilation with LOCALIZE=OFF (CleverRaven#65548)
Browse files Browse the repository at this point in the history
  • Loading branch information
perryprog authored May 9, 2023
1 parent a3dd8c6 commit 922d784
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -635,12 +635,15 @@ void game::toggle_pixel_minimap() const

void game::toggle_language_to_en()
{
// No-op if we aren't complied with localization
#if defined(LOCALIZE)
const std::string english = "en" ;
static std::string secondary_lang = english;
std::string current_lang = TranslationManager::GetInstance().GetCurrentLanguage();
secondary_lang = current_lang != english ? current_lang : secondary_lang;
std::string new_lang = current_lang != english ? english : secondary_lang;
set_language( new_lang );
#endif
}

bool game::is_tileset_isometric() const
Expand Down
3 changes: 3 additions & 0 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,9 @@ void set_language( const std::string &lang )
current_language_version++;
} while( current_language_version == INVALID_LANGUAGE_VERSION );

#else
// Silence unused var warning
( void ) lang;
#endif // LOCALIZE

reload_names();
Expand Down

0 comments on commit 922d784

Please sign in to comment.