From a941255a58efdadccfa926a4cd898658814a00df Mon Sep 17 00:00:00 2001 From: Rob B Date: Tue, 3 Sep 2024 16:58:12 -0400 Subject: [PATCH] Simplify language selector implementation --- .../first-time-setup/LanguageSelector.svelte | 40 +++++-------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/frontend/src/lib/components/modals/first-time-setup/LanguageSelector.svelte b/frontend/src/lib/components/modals/first-time-setup/LanguageSelector.svelte index 7ff909f1..6b159c9e 100644 --- a/frontend/src/lib/components/modals/first-time-setup/LanguageSelector.svelte +++ b/frontend/src/lib/components/modals/first-time-setup/LanguageSelector.svelte @@ -5,51 +5,31 @@ let languages: string[] = Object.keys(i18n); - type DropdownItem = { - value: string; - label: string; - }; - - function prepLocale(locale: string) { - return { - value: locale, - label: localeName(locale), - }; - } - - let dropdownItemData = languages.map(prepLocale); - function localeName(locale: string) { if (!locale) return 'N/A'; return new Intl.DisplayNames([locale], { type: 'language' }).of(locale) ?? `Error:${locale}`; } - - async function languageSelectChanged(selection: CustomEvent) { - $language = selection.detail.value; - } - \ No newline at end of file