Skip to content

Commit eed6b5f

Browse files
feat: [IPR-1063] Add warning for unsupported locacale
1 parent aeb69be commit eed6b5f

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

packages/scratch-gui/src/lib/editor-state.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,12 @@ export class EditorState {
4343
let initializedLocales = localesInitialState;
4444

4545
let locale = 'en';
46-
if (params.locale && Object.keys(locales).includes(params.locale)) {
47-
locale = params.locale;
46+
if (params.locale) {
47+
if (Object.keys(locales).includes(params.locale)) {
48+
locale = params.locale;
49+
} else {
50+
console.warn(`Unsupported locale ${params.locale}, falling back to en`);
51+
}
4852
} else {
4953
locale = detectLocale(Object.keys(locales));
5054
}

0 commit comments

Comments
 (0)