mirror of
https://github.com/scratchfoundation/scratch-vm.git
synced 2024-12-24 06:52:40 -05:00
Support dropped language names
This commit is contained in:
parent
5ba476c833
commit
5e84441542
1 changed files with 9 additions and 0 deletions
|
@ -519,6 +519,15 @@ class Scratch3Text2SpeechBlocks {
|
|||
stage.textToSpeechLanguage = this._getExtensionLocaleForSupportedLocale(locale);
|
||||
}
|
||||
|
||||
// Support language names dropped onto the menu via reporter block
|
||||
// such as a variable containing a language name (in any language),
|
||||
// or the translate extension's language reporter.
|
||||
const localeForDroppedName = languageNames.nameMap[locale.toLowerCase()];
|
||||
if (localeForDroppedName && this.isSupportedLanguage(localeForDroppedName)) {
|
||||
stage.textToSpeechLanguage =
|
||||
this._getExtensionLocaleForSupportedLocale(localeForDroppedName);
|
||||
}
|
||||
|
||||
// If the language is null, set it to the default language.
|
||||
// This can occur e.g. if the extension was loaded with the editor
|
||||
// set to a language that is not in the list.
|
||||
|
|
Loading…
Reference in a new issue