Use lowercase lang code for editor lang (to match ja-Hira)

This commit is contained in:
Eric Rosenbaum 2019-10-03 12:42:50 -04:00
parent 03e6d73cc6
commit dad1ced3d4

View file

@ -602,12 +602,13 @@ class Scratch3Text2SpeechBlocks {
* @return {array} the text and value for each menu item. * @return {array} the text and value for each menu item.
*/ */
getLanguageMenu () { getLanguageMenu () {
const editorLanguage = this.getEditorLanguage().toLowerCase();
// Get the array of localized language names // Get the array of localized language names
const localizedNameMap = {}; const localizedNameMap = {};
let nameArray = languageNames.menuMap[this.getEditorLanguage()]; 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[this.getEditorLanguage()]; const spokenNameArray = languageNames.spokenLanguages[editorLanguage];
if (spokenNameArray) { if (spokenNameArray) {
nameArray = nameArray.concat(spokenNameArray); nameArray = nameArray.concat(spokenNameArray);
} }