i18n: localize profile menu
This commit is contained in:
1 parent
c4236fa124
commit
0f0e34d347
5 files changed
+180
-17
No files matched your search
@@ -1,6 +1,8 @@
|
||||
import type { CommentSortType, SortType } from 'lemmy-js-client'
|
||||
import { writable } from 'svelte/store'
|
||||
import { env } from '$env/dynamic/public'
|
||||
import { locale } from './translations'
|
||||
import { browser } from '$app/environment'
|
||||
|
||||
console.log('Using the following default settings from the environment:')
|
||||
console.log(env)
|
||||
@@ -168,4 +170,9 @@ userSettings.subscribe((settings) => {
|
||||
if (typeof window != 'undefined') {
|
||||
localStorage.setItem('settings', JSON.stringify(settings))
|
||||
}
|
||||
if (settings.language) {
|
||||
locale.set(settings.language)
|
||||
} else {
|
||||
if (browser) locale.set(navigator?.language)
|
||||
}
|
||||
})
|
||||
Reference in new issue
Block a user