mirror of
https://github.com/immich-app/immich
synced 2026-08-15 13:03:57 +00:00
fix(web): always initialize language manager to set lang and dir (#29696)
This commit is contained in:
parent
fea0db02f3
commit
2db1e02cdf
2 changed files with 11 additions and 1 deletions
|
|
@ -5,12 +5,20 @@ import { langs } from '$lib/utils/i18n';
|
|||
class LanguageManager {
|
||||
constructor() {
|
||||
eventManager.on({
|
||||
AppInit: () => lang.subscribe((lang) => this.setLanguage(lang)),
|
||||
AppInit: () => this.init(),
|
||||
});
|
||||
}
|
||||
|
||||
initialized = $state(false);
|
||||
rtl = $state(false);
|
||||
|
||||
init() {
|
||||
if (!this.initialized) {
|
||||
this.initialized = true;
|
||||
lang.subscribe((lang) => this.setLanguage(lang));
|
||||
}
|
||||
}
|
||||
|
||||
setLanguage(code: string) {
|
||||
const item = langs.find((item) => item.code === code);
|
||||
if (!item) {
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
import { commandPaletteManager } from '@immich/ui';
|
||||
import { goto } from '$app/navigation';
|
||||
import { languageManager } from '$lib/managers/language-manager.svelte';
|
||||
import { serverConfigManager } from '$lib/managers/server-config-manager.svelte';
|
||||
import { maintenanceCreateUrl, maintenanceReturnUrl, maintenanceShouldRedirect } from '$lib/utils/maintenance';
|
||||
import { init } from '$lib/utils/server';
|
||||
|
|
@ -23,6 +24,7 @@ export const load = (async ({ fetch, url }) => {
|
|||
}
|
||||
|
||||
commandPaletteManager.enable();
|
||||
languageManager.init();
|
||||
|
||||
return {
|
||||
error,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue