refactor: app init event (#17937)

This commit is contained in:
Jason Rasmussen
2025-04-28 14:48:33 -04:00
committed by GitHub
parent 895b2bf5cd
commit 7f69abbf0d
19 changed files with 81 additions and 75 deletions

View File

@@ -1,7 +1,12 @@
import { langs } from '$lib/constants';
import { eventManager } from '$lib/managers/event-manager.svelte';
import { lang } from '$lib/stores/preferences.store';
class LanguageManager {
constructor() {
eventManager.on('app.init', () => lang.subscribe((lang) => this.setLanguage(lang)));
}
rtl = $state(false);
setLanguage(code: string) {