We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents eb20538 + 4c04d36 commit 7d27921Copy full SHA for 7d27921
examples/locale-router-static/src/routes/[lang]/+layout.svelte
@@ -22,8 +22,13 @@
22
<br />
23
24
25
-<select on:change="{({ target }) => goto(target.value)}">
+<select
26
+ on:change={({ target }) => {
27
+ goto(`/${target.value}${route}`);
28
+ document.querySelector('html').setAttribute('lang', target.value);
29
+ }}
30
+>
31
{#each $locales as lc}
- <option value="/{lc}{route}" selected="{lc === $locale}">{$t(`lang.${lc}`)}</option>
32
+ <option value={lc} selected={lc === $locale}>{$t(`lang.${lc}`)}</option>
33
{/each}
34
</select>
0 commit comments