Check for spokenLanguages object

This commit is contained in:
Eric Rosenbaum 2019-10-29 11:39:14 -04:00
parent 246e40a68c
commit 83781fd380

View file

@ -609,8 +609,9 @@ class Scratch3Text2SpeechBlocks {
let nameArray = languageNames.menuMap[editorLanguage]; let nameArray = languageNames.menuMap[editorLanguage];
if (nameArray) { if (nameArray) {
// Also get any localized names of spoken languages // Also get any localized names of spoken languages
const spokenNameArray = languageNames.spokenLanguages[editorLanguage]; let spokenNameArray = [];
if (spokenNameArray) { if (languageNames.spokenLanguages) {
spokenNameArray = languageNames.spokenLanguages[editorLanguage];
nameArray = nameArray.concat(spokenNameArray); nameArray = nameArray.concat(spokenNameArray);
} }
// Create a map of language code to localized name // Create a map of language code to localized name