feat: dynamic languages (#27869)

Co-authored-by: xantin <github@xantin.be>
This commit is contained in:
Jason Rasmussen
2026-04-16 12:37:37 -04:00
committed by GitHub
parent 88bce52042
commit 6aadb7b5bd
6 changed files with 120 additions and 127 deletions
@@ -1,9 +1,9 @@
<script lang="ts">
import { invalidateAll } from '$app/navigation';
import Combobox from '$lib/components/shared-components/combobox.svelte';
import { defaultLang, langs } from '$lib/constants';
import { defaultLang } from '$lib/constants';
import { lang } from '$lib/stores/preferences.store';
import { getClosestAvailableLocale, langCodes } from '$lib/utils/i18n';
import { getClosestAvailableLocale, langCodes, langs } from '$lib/utils/i18n';
import { Label, Text } from '@immich/ui';
import { locale as i18nLocale, t } from 'svelte-i18n';
@@ -13,14 +13,7 @@
let { showSettingDescription = false }: Props = $props();
const langOptions = langs
.map((lang) => ({ label: lang.name, value: lang.code }))
.sort((a, b) => {
if (b.label.startsWith('Development')) {
return -1;
}
return a.label.localeCompare(b.label);
});
const langOptions = langs.map((lang) => ({ label: lang.name, value: lang.code }));
const defaultLangOption = { label: defaultLang.name, value: defaultLang.code };