Add explanatory comment

This commit is contained in:
Eric Rosenbaum 2019-10-31 16:03:50 -04:00
parent 64eace3b90
commit 27c424532f

View file

@ -615,6 +615,11 @@ class Scratch3Text2SpeechBlocks {
nameArray = nameArray.concat(spokenNameArray);
}
// Create a map of language code to localized name
// The localized spoken language names have been concatenated onto
// the end of the name array, so the result of the forEach below is
// when there is both a written language name (e.g. 'Chinese
// (simplified)') and a spoken language name (e.g. 'Chinese
// (Mandarin)', we always use the spoken version.
nameArray.forEach(lang => {
localizedNameMap[lang.code] = lang.name;
});