Skip to content

Commit 4097185

Browse files
authored
fix(lyrics-plus): correctly detect non-standard language from Musixmatch providers (#3596)
1 parent 4d82e1b commit 4097185

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

CustomApps/lyrics-plus/OptionsMenu.js

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,12 @@ const TranslationMenu = react.memo(({ friendlyLanguage, hasTranslation, musixmat
127127

128128
if (availableMusixmatchLanguages.length) {
129129
const musixmatchOptions = availableMusixmatchLanguages.reduce((acc, code) => {
130-
const label = musixmatchDisplay.of(code) || code.toUpperCase();
130+
let label = "";
131+
try {
132+
label = musixmatchDisplay.of(code) ?? code.toUpperCase();
133+
} catch (e) {
134+
label = code.toUpperCase();
135+
}
131136
acc[`${musixmatchTranslationPrefix}${code}`] = `${label} (Musixmatch)`;
132137
return acc;
133138
}, {});

0 commit comments

Comments
 (0)