pleroma-fe/src/lib/language.js

14 lines
395 B
JavaScript
Raw Normal View History

2026-02-13 14:11:33 +02:00
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)
}
}
})
}
}