diff options
author | Bastien Bouclet | 2018-09-27 07:12:11 +0200 |
---|---|---|
committer | Bastien Bouclet | 2018-12-02 19:47:32 +0100 |
commit | bbbd40477d1afe62df63b222193e016d1e9fdd7d (patch) | |
tree | 4d4e69d9631a725aeef2a10a27d075e1ed6823e3 /base | |
parent | add9a0b49a39a9e2a3c3cd3376afd3a4b7f71937 (diff) | |
download | scummvm-rg350-bbbd40477d1afe62df63b222193e016d1e9fdd7d.tar.gz scummvm-rg350-bbbd40477d1afe62df63b222193e016d1e9fdd7d.tar.bz2 scummvm-rg350-bbbd40477d1afe62df63b222193e016d1e9fdd7d.zip |
GUI: Add an option to set the GUI language to the game language
Diffstat (limited to 'base')
-rw-r--r-- | base/main.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/base/main.cpp b/base/main.cpp index c43b865251..e9c0b967d3 100644 --- a/base/main.cpp +++ b/base/main.cpp @@ -254,6 +254,15 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common warning(_("Engine does not support debug level '%s'"), token.c_str()); } +#ifdef USE_TRANSLATION + Common::String previousLanguage = TransMan.getCurrentLanguage(); + if (ConfMan.hasKey("gui_use_game_language") + && ConfMan.getBool("gui_use_game_language") + && ConfMan.hasKey("language")) { + TransMan.setLanguage(ConfMan.get("language")); + } +#endif + // Initialize any game-specific keymaps engine->initKeymap(); @@ -278,6 +287,10 @@ static Common::Error runGame(const Plugin *plugin, OSystem &system, const Common // Reset the file/directory mappings SearchMan.clear(); +#ifdef USE_TRANSLATION + TransMan.setLanguage(previousLanguage); +#endif + // Return result (== 0 means no error) return result; } |