diff options
Diffstat (limited to 'gui')
-rw-r--r-- | gui/gui-manager.cpp | 13 | ||||
-rw-r--r-- | gui/options.cpp | 19 |
2 files changed, 19 insertions, 13 deletions
diff --git a/gui/gui-manager.cpp b/gui/gui-manager.cpp index f33fc39a6f..8cb201da3a 100644 --- a/gui/gui-manager.cpp +++ b/gui/gui-manager.cpp @@ -625,16 +625,21 @@ void GuiManager::setLastMousePos(int16 x, int16 y) { #ifdef USE_TTS void GuiManager::initTextToSpeech() { -#if defined(USE_TRANSLATION) && defined(USE_LINUX_TTS) - if(ConfMan.hasKey("gui_language") && ConfMan.get("gui_language") != "C") - warning("TTS on linux is supported only for english"); + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); +#ifdef USE_TRANSLATION + Common::String currentLanguage = TransMan.getCurrentLanguage(); + if (currentLanguage != "C") { + currentLanguage.setChar('\0', 2); + debug("%s", TransMan.getCurrentCharset().c_str()); + ttsMan->setLanguage(currentLanguage); + } #endif int voice; if(ConfMan.hasKey("tts_voice")) voice = ConfMan.getInt("tts_voice", "scummvm"); else voice = 0; - g_system->getTextToSpeechManager()->setVoice(voice); + ttsMan->setVoice(voice); } #endif diff --git a/gui/options.cpp b/gui/options.cpp index e0e0cdf6b7..39bf6160ea 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -2149,19 +2149,20 @@ void GlobalOptionsDialog::apply() { error.runModal(); } #ifdef USE_TTS - bool ttsCheckboxChanged = _ttsCheckbox->getState() && - (!ConfMan.hasKey("tts_enabled") || !ConfMan.getBool("tts_enabled")); - bool languageChanged = (newLang != oldLang); - if (ttsCheckboxChanged || languageChanged) { -#if defined(USE_TRANSLATION) && defined(USE_LINUX_TTS) - if (ConfMan.get("gui_language") != "C") - warning("TTS on linux is supported only for english"); -#endif + Common::TextToSpeechManager *ttsMan = g_system->getTextToSpeechManager(); + if (newLang != oldLang) { + if (newLang == "C") + ttsMan->setLanguage("en"); + else { + Common::String guiLang = newLang; + guiLang.setChar('\0', 2); + ttsMan->setLanguage(guiLang); + } } ConfMan.setBool("tts_enabled", _ttsCheckbox->getState(), _domain); int selectedVoice = _ttsVoiceSelectionPopUp->getSelectedTag(); ConfMan.setInt("tts_voice", selectedVoice, _domain); - g_system->getTextToSpeechManager()->setVoice(selectedVoice); + ttsMan->setVoice(selectedVoice); #endif if (isRebuildNeeded) { |