We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5659d0e commit 2ae989dCopy full SHA for 2ae989d
LocaleSelector.svelte
@@ -1,7 +1,7 @@
1
<script>
2
import { locale } from "./locale.js";
3
import recognition from "./recognition.js";
4
- let selectedLocaleCode;
+ let selectedLocaleCode = locale.getCurrentLocaleCode();
5
</script>
6
7
<style>
locale.js
@@ -15,6 +15,9 @@ const getInitialLocale = () => {
15
};
16
17
let currentLocaleCode = getInitialLocale().substr(0, 2);
18
+
19
+if (!(currentLocaleCode in locales)) currentLocaleCode = "en";
20
21
let currentLocale = locales[currentLocaleCode];
22
23
console.log(`Initial locale ${currentLocaleCode}`);
0 commit comments