migrate: change settings from a store to a state
This commit is contained in:
1 parent
ffcd9faa96
commit
d597349887
128 files changed
+1010
-1144
No files matched your search
@@ -1,6 +1,6 @@
|
||||
import { browser } from '$app/environment'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import { userSettings } from '$lib/settings.js'
|
||||
import { settings } from '$lib/settings.svelte'
|
||||
import { aliases, loadTranslations } from '$lib/translations.js'
|
||||
import { get } from 'svelte/store'
|
||||
|
||||
@@ -9,7 +9,7 @@ export let ssr = (env.PUBLIC_SSR_ENABLED?.toLowerCase() ?? 'false') == 'true'
|
||||
export const load = async ({}) => {
|
||||
if (browser) {
|
||||
const initLocale =
|
||||
get(userSettings)?.language ?? navigator?.language ?? 'en'
|
||||
settings.language ?? navigator?.language ?? 'en'
|
||||
|
||||
console.log(`Loading locale ${aliases.get(initLocale) ?? initLocale}`)
|
||||
|
||||
|
||||
Reference in new issue
Block a user