From bbbd40477d1afe62df63b222193e016d1e9fdd7d Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Thu, 27 Sep 2018 07:12:11 +0200 Subject: GUI: Add an option to set the GUI language to the game language --- base/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'base') 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; } -- cgit v1.2.3