2026-01-23 12:40:45 +02:00
|
|
|
import { useI18nStore } from 'src/stores/i18n.js'
|
|
|
|
|
|
|
|
|
|
export const piniaLanguagePlugin = ({ store, options }) => {
|
|
|
|
|
if (store.$id === 'sync_config') {
|
|
|
|
|
store.$onAction(({ name, args }) => {
|
2026-01-23 13:06:09 +02:00
|
|
|
if (name === 'setPreference') {
|
|
|
|
|
const { path, value } = args[0]
|
|
|
|
|
if (path === 'simple.interfaceLanguage') {
|
|
|
|
|
useI18nStore().setLanguage(value)
|
|
|
|
|
}
|
2026-01-23 12:40:45 +02:00
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|