mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
parent
d8175d8da8
commit
9fc9465cec
4 changed files with 50 additions and 15 deletions
|
|
@ -1,5 +1,6 @@
|
|||
import { NotificationType, notificationController } from '$lib/components/shared-components/notification/notification';
|
||||
import { locales } from '$lib/constants';
|
||||
import { defaultLang, langs, locales } from '$lib/constants';
|
||||
import { lang } from '$lib/stores/preferences.store';
|
||||
import { handleError } from '$lib/utils/handle-error';
|
||||
import {
|
||||
AssetJobName,
|
||||
|
|
@ -20,7 +21,7 @@ import {
|
|||
} from '@immich/sdk';
|
||||
import { mdiCogRefreshOutline, mdiDatabaseRefreshOutline, mdiImageRefreshOutline } from '@mdi/js';
|
||||
import { sortBy } from 'lodash-es';
|
||||
import { t } from 'svelte-i18n';
|
||||
import { init, register, t } from 'svelte-i18n';
|
||||
import { derived, get } from 'svelte/store';
|
||||
|
||||
interface DownloadRequestOptions<T = unknown> {
|
||||
|
|
@ -31,6 +32,15 @@ interface DownloadRequestOptions<T = unknown> {
|
|||
onDownloadProgress?: (event: ProgressEvent<XMLHttpRequestEventTarget>) => void;
|
||||
}
|
||||
|
||||
export const initApp = async () => {
|
||||
const preferenceLang = get(lang);
|
||||
for (const { code, loader } of langs) {
|
||||
register(code, loader);
|
||||
}
|
||||
|
||||
await init({ fallbackLocale: preferenceLang === 'dev' ? 'dev' : defaultLang.code, initialLocale: preferenceLang });
|
||||
};
|
||||
|
||||
interface UploadRequestOptions {
|
||||
url: string;
|
||||
method?: 'POST' | 'PUT';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue