Skip to content

Commit

Permalink
Merge pull request #40054 from jbytheway/log_locale_info
Browse files Browse the repository at this point in the history
Log locale info to help debug i18n
  • Loading branch information
ifreund authored May 1, 2020
2 parents 8bea388 + d106065 commit a8bbd72
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,9 @@ int main( int argc, char *argv[] )
}
#endif

DebugLog( D_INFO, DC_ALL ) << "[main] C locale set to " << setlocale( LC_ALL, nullptr );
DebugLog( D_INFO, DC_ALL ) << "[main] C++ locale set to " << std::locale().name();

#if defined(TILES)
SDL_version compiled;
SDL_VERSION( &compiled );
Expand Down
3 changes: 3 additions & 0 deletions src/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3130,4 +3130,7 @@ void options_manager::update_global_locale()
} catch( std::runtime_error &e ) {
std::locale::global( std::locale() );
}

DebugLog( D_INFO, DC_ALL ) << "[options] C locale set to " << setlocale( LC_ALL, nullptr );
DebugLog( D_INFO, DC_ALL ) << "[options] C++ locale set to " << std::locale().name();
}
2 changes: 2 additions & 0 deletions src/translations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,8 @@ void set_language()
if( setlocale( LC_ALL, ".1252" ) == nullptr ) {
DebugLog( D_WARNING, D_MAIN ) << "Error while setlocale(LC_ALL, '.1252').";
}
DebugLog( D_INFO, DC_ALL ) << "[translations] C locale set to " << setlocale( LC_ALL, nullptr );
DebugLog( D_INFO, DC_ALL ) << "[translations] C++ locale set to " << std::locale().name();
#endif

// Step 2. Bind to gettext domain.
Expand Down

0 comments on commit a8bbd72

Please sign in to comment.