2 import { locale, locales } from 'svelte-i18n';
3 import { getLangNameFromCode } from 'language-name-map';
5 $: namedLocales = $locales
8 ...getLangNameFromCode(code)
10 .sort((a, b) => a.native - b.native);
12 let selected = $locale;
15 console.log(`the current locale is ${selected}`);
20 <select bind:value={selected}>
21 {#each namedLocales as namedLocale}
22 <option value="{ namedLocale.code }">{ namedLocale.native }</option>