fixed up language
This commit is contained in:
parent
9822ebc3bf
commit
a5b3840d06
4 changed files with 49 additions and 34 deletions
|
|
@ -209,6 +209,7 @@ export const useEmojiStore = defineStore('emoji', {
|
|||
)
|
||||
}
|
||||
|
||||
console.log('EMOJI', useInstanceStore().server)
|
||||
const emoji = Object.entries(values)
|
||||
.map(([key, value]) => {
|
||||
const imageUrl = value.image_url
|
||||
|
|
|
|||
|
|
@ -1,5 +1,14 @@
|
|||
import Cookies from 'js-cookie'
|
||||
import { defineStore } from 'pinia'
|
||||
|
||||
import { useEmojiStore } from 'src/stores/emoji.js'
|
||||
import { useSyncConfigStore } from 'src/stores/sync_config.js'
|
||||
|
||||
import messages from 'src/i18n/messages'
|
||||
import localeService from 'src/services/locale/locale.service.js'
|
||||
|
||||
const BACKEND_LANGUAGE_COOKIE_NAME = 'userLanguage'
|
||||
|
||||
export const useI18nStore = defineStore('i18n', {
|
||||
state: () => ({
|
||||
i18n: null,
|
||||
|
|
@ -10,5 +19,15 @@ export const useI18nStore = defineStore('i18n', {
|
|||
i18n: newI18n.global,
|
||||
})
|
||||
},
|
||||
setLanguage(originalValue) {
|
||||
const value =
|
||||
originalValue || useSyncConfigStore().mergedConfig.interfaceLanguage
|
||||
messages.setLanguage(this.i18n, value)
|
||||
useEmojiStore().loadUnicodeEmojiData(value)
|
||||
Cookies.set(
|
||||
BACKEND_LANGUAGE_COOKIE_NAME,
|
||||
localeService.internalToBackendLocaleMulti(value),
|
||||
)
|
||||
},
|
||||
},
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue