main.js
This commit is contained in:
parent
69656e0181
commit
c9dede920e
4 changed files with 133 additions and 26 deletions
14
src/lib/language.js
Normal file
14
src/lib/language.js
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { useI18nStore } from 'src/stores/i18n.js'
|
||||
|
||||
export const piniaLanguagePlugin = ({ store, options }) => {
|
||||
if (store.$id === 'sync_config') {
|
||||
store.$onAction(({ name, args }) => {
|
||||
if (name === 'setPreference') {
|
||||
const { path, value } = args[0]
|
||||
if (path === 'simple.interfaceLanguage') {
|
||||
useI18nStore().setLanguage(value)
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue