mirror of
https://github.com/wukko/cobalt.git
synced 2024-11-15 12:50:01 +00:00
web/LanguageDropdown: refactor
This commit is contained in:
parent
b3954b9209
commit
1850264da7
1 changed files with 4 additions and 5 deletions
|
@ -1,14 +1,13 @@
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import settings, { updateSetting } from "$lib/state/settings";
|
|
||||||
import { t, locales } from "$lib/i18n/translations";
|
|
||||||
import locale from "$lib/i18n/locale";
|
import locale from "$lib/i18n/locale";
|
||||||
|
|
||||||
import languages from "$i18n/languages.json";
|
import languages from "$i18n/languages.json";
|
||||||
|
|
||||||
|
import { t, locales } from "$lib/i18n/translations";
|
||||||
|
import settings, { updateSetting } from "$lib/state/settings";
|
||||||
|
|
||||||
import IconSelector from "@tabler/icons-svelte/IconSelector.svelte";
|
import IconSelector from "@tabler/icons-svelte/IconSelector.svelte";
|
||||||
|
|
||||||
$: currentSetting = $settings.appearance.language;
|
$: currentSetting = $settings.appearance.language;
|
||||||
|
|
||||||
$: disabled = $settings.appearance.autoLanguage;
|
$: disabled = $settings.appearance.autoLanguage;
|
||||||
|
|
||||||
const updateLocale = (lang: string) => {
|
const updateLocale = (lang: string) => {
|
||||||
|
@ -37,7 +36,7 @@
|
||||||
id="setting-dropdown-appearance-language"
|
id="setting-dropdown-appearance-language"
|
||||||
bind:value={$locale}
|
bind:value={$locale}
|
||||||
on:change={() => updateLocale($locale)}
|
on:change={() => updateLocale($locale)}
|
||||||
disabled={disabled}
|
{disabled}
|
||||||
>
|
>
|
||||||
{#each $locales as value}
|
{#each $locales as value}
|
||||||
<option {value} selected={currentSetting === value}>
|
<option {value} selected={currentSetting === value}>
|
||||||
|
|
Loading…
Reference in a new issue