2 import { locale, locales } from 'svelte-i18n';
3 import { getLangNameFromCode } from 'language-name-map';
4 import { goto } from '$app/navigation';
6 $: namedLocales = $locales
9 ...getLangNameFromCode(code)
11 .sort((a, b) => a.native - b.native);
13 let selected = $locale;
19 const navigateAway = function () {
24 <select bind:value={selected} on:change={navigateAway}>
25 {#each namedLocales as namedLocale}
26 <option value={namedLocale.code}>{namedLocale.native}</option>