Skip to content

Commit

Permalink
fix: call set_language even when LOCALIZE is off
Browse files Browse the repository at this point in the history
This was causing a frankly hilarious bug that would cause Name::get to return
"Tom" no matter what search flags were passed whenever localization was
disabled. This meant that EVERYTHING was Tom. Have you been to Tom Town yet? No?
That's because it's also called Tom Tom. Can't remember that person's name? It's
Tom. Their last name? Also Tom. Committing some identity theft but stuck on
"Mother's maiden name"? I'll give you a hint: it's Tom.

This commit should fix this disastrous issue by making sure set_language, which
is what loads the names file initially, gets called even when localization is
disabled.
  • Loading branch information
perryprog committed Jun 25, 2023
1 parent 00a5498 commit 02448fe
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ void set_language_from_options()
std::string lang_opt = get_option<std::string>( "USE_LANG" ).empty() ? system_lang :
get_option<std::string>( "USE_LANG" );
set_language( lang_opt );
#else
set_language( "en" );
#endif
}

Expand Down

0 comments on commit 02448fe

Please sign in to comment.