fix(web): add missing @immich/ui translations (#26143)

This commit is contained in:
Michel Heusschen
2026-02-12 17:42:35 +01:00
committed by GitHub
parent 81f592ca52
commit b85f6f3fce
5 changed files with 168 additions and 47 deletions

View File

@@ -27,7 +27,7 @@
"@formatjs/icu-messageformat-parser": "^3.0.0",
"@immich/justified-layout-wasm": "^0.4.3",
"@immich/sdk": "file:../open-api/typescript-sdk",
"@immich/ui": "^0.62.0",
"@immich/ui": "^0.62.1",
"@mapbox/mapbox-gl-rtl-text": "0.2.3",
"@mdi/js": "^7.4.47",
"@photo-sphere-viewer/core": "^5.14.0",

View File

@@ -1,10 +1,8 @@
<script lang="ts">
import { shortcut } from '$lib/actions/shortcut';
import { defaultLang, langs, Theme } from '$lib/constants';
import { Theme } from '$lib/constants';
import { themeManager } from '$lib/managers/theme-manager.svelte';
import { lang } from '$lib/stores/preferences.store';
import { ThemeSwitcher } from '@immich/ui';
import { get } from 'svelte/store';
const handleToggleTheme = () => {
if (themeManager.theme.system) {
@@ -18,14 +16,9 @@
<svelte:window use:shortcut={{ shortcut: { key: 't', alt: true }, onShortcut: () => handleToggleTheme() }} />
{#if !themeManager.theme.system}
{#await langs
.find((item) => item.code === get(lang))
?.loader() ?? defaultLang.loader() then { default: translations }}
<ThemeSwitcher
size="medium"
color="secondary"
{translations}
onChange={(theme) => themeManager.setTheme(theme == 'dark' ? Theme.DARK : Theme.LIGHT)}
/>
{/await}
<ThemeSwitcher
size="medium"
color="secondary"
onChange={(theme) => themeManager.setTheme(theme == 'dark' ? Theme.DARK : Theme.LIGHT)}
/>
{/if}

View File

@@ -40,17 +40,32 @@
$effect(() => {
setTranslations({
cancel: $t('cancel'),
close: $t('close'),
confirm: $t('confirm'),
expand: $t('expand'),
collapse: $t('collapse'),
search_placeholder: $t('search'),
search_no_results: $t('no_results'),
prompt_default: $t('are_you_sure_to_do_this'),
show_password: $t('show_password'),
hide_password: $t('hide_password'),
confirm: $t('confirm'),
cancel: $t('cancel'),
dark_theme: $t('dark_theme'),
open_menu: $t('open'),
command_palette_prompt_default: $t('command_palette_prompt'),
command_palette_to_select: $t('command_palette_to_select'),
command_palette_to_navigate: $t('command_palette_to_navigate'),
command_palette_to_close: $t('command_palette_to_close'),
command_palette_to_show_all: $t('command_palette_to_show_all'),
navigate_next: $t('next'),
navigate_previous: $t('previous'),
open_calendar: $t('open_calendar'),
toast_success_title: $t('success'),
toast_info_title: $t('info'),
toast_warning_title: $t('warning'),
toast_danger_title: $t('error'),
navigate_next: $t('next'),
navigate_previous: $t('previous'),
save: $t('save'),
supporter: $t('supporter'),
});
});