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

View file

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

View file

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

View file

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