COMMON: Change TransMan builtin language to "en" instead of "C"

This commit is contained in:
Thierry Crozat 2021-07-16 21:52:48 +01:00
parent 28e9598eb1
commit cbb627a40b
5 changed files with 6 additions and 14 deletions

View file

@ -144,8 +144,6 @@ Array<int> TextToSpeechManager::getVoiceIndicesByGender(TTSVoice::Gender gender)
} }
void TextToSpeechManager::setLanguage(Common::String language) { void TextToSpeechManager::setLanguage(Common::String language) {
if (language == "C")
language = "en";
// The speech manager uses the ISO 639-1 for language codes (2 letter code) // The speech manager uses the ISO 639-1 for language codes (2 letter code)
// if we get a longer language string, just take the first 2 letters from that // if we get a longer language string, just take the first 2 letters from that
// if it won't be a valid language code, the Manager just won't find any voice // if it won't be a valid language code, the Manager just won't find any voice

View file

@ -172,7 +172,7 @@ String TranslationManager::getCurrentCharset() const {
String TranslationManager::getCurrentLanguage() const { String TranslationManager::getCurrentLanguage() const {
if (_currentLang == -1) if (_currentLang == -1)
return "C"; return "en";
return _langs[_currentLang]; return _langs[_currentLang];
} }
@ -211,7 +211,7 @@ String TranslationManager::getLangById(int id) const {
case kTranslationAutodetectId: case kTranslationAutodetectId:
return ""; return "";
case kTranslationBuiltinId: case kTranslationBuiltinId:
return "C"; return "en";
default: default:
if (id >= 0 && id - 1 < (int)_langs.size()) if (id >= 0 && id - 1 < (int)_langs.size())
return _langs[id - 1]; return _langs[id - 1];

View file

@ -527,7 +527,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &language, const
#ifdef USE_TRANSLATION #ifdef USE_TRANSLATION
Common::String cl = TransMan.getCurrentLanguage(); Common::String cl = TransMan.getCurrentLanguage();
#else #else
Common::String cl("C"); Common::String cl("en");
#endif #endif
if (!cl.matchString(language, true)) if (!cl.matchString(language, true))
return true; // Skip return true; // Skip
@ -562,7 +562,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &language, const
if (!_texts[textId]->_fontPtr) { if (!_texts[textId]->_fontPtr) {
error("Couldn't load font '%s'/'%s'", file.c_str(), scalableFile.c_str()); error("Couldn't load font '%s'/'%s'", file.c_str(), scalableFile.c_str());
#ifdef USE_TRANSLATION #ifdef USE_TRANSLATION
TransMan.setLanguage("C"); TransMan.setLanguage("en");
Common::TextToSpeechManager *ttsMan; Common::TextToSpeechManager *ttsMan;
if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr) if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr)
ttsMan->setLanguage("en"); ttsMan->setLanguage("en");
@ -578,7 +578,7 @@ bool ThemeEngine::addFont(TextData textId, const Common::String &language, const
// However, still returns false here, probably to avoid ugly / garbage glyphs side-effects // However, still returns false here, probably to avoid ugly / garbage glyphs side-effects
// FIXME If we return false anyway why would we attempt the fall-back in the first place? // FIXME If we return false anyway why would we attempt the fall-back in the first place?
#ifdef USE_TRANSLATION #ifdef USE_TRANSLATION
TransMan.setLanguage("C"); TransMan.setLanguage("en");
Common::TextToSpeechManager *ttsMan; Common::TextToSpeechManager *ttsMan;
if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr) if ((ttsMan = g_system->getTextToSpeechManager()) != nullptr)
ttsMan->setLanguage("en"); ttsMan->setLanguage("en");

View file

@ -759,8 +759,6 @@ void GuiManager::initTextToSpeech() {
return; return;
#ifdef USE_TRANSLATION #ifdef USE_TRANSLATION
Common::String currentLanguage = TransMan.getCurrentLanguage(); Common::String currentLanguage = TransMan.getCurrentLanguage();
if (currentLanguage == "C")
currentLanguage = "en";
ttsMan->setLanguage(currentLanguage); ttsMan->setLanguage(currentLanguage);
#endif #endif
int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256; int volume = (ConfMan.getInt("speech_volume", "scummvm") * 100) / 256;

View file

@ -2644,11 +2644,7 @@ void GlobalOptionsDialog::apply() {
if (ttsMan) { if (ttsMan) {
#ifdef USE_TRANSLATION #ifdef USE_TRANSLATION
if (newLang != oldLang) { if (newLang != oldLang) {
if (newLang == "C")
ttsMan->setLanguage("en");
else {
ttsMan->setLanguage(newLang); ttsMan->setLanguage(newLang);
}
_ttsVoiceSelectionPopUp->setSelected(0); _ttsVoiceSelectionPopUp->setSelected(0);
} }
#else #else