Revert "fix(ui): Remove dynamic import for i18n in settings store"
This reverts commit 0216325e0f.
This commit is contained in:
parent
f6a0ea3a96
commit
678e17bb5c
1 changed files with 5 additions and 4 deletions
|
|
@ -3,7 +3,6 @@ import { persist, createJSONStorage } from 'zustand/middleware'
|
||||||
import { createSelectors } from '@/lib/utils'
|
import { createSelectors } from '@/lib/utils'
|
||||||
import { defaultQueryLabel } from '@/lib/constants'
|
import { defaultQueryLabel } from '@/lib/constants'
|
||||||
import { Message, QueryRequest } from '@/api/lightrag'
|
import { Message, QueryRequest } from '@/api/lightrag'
|
||||||
import i18n from '@/i18n'
|
|
||||||
|
|
||||||
type Theme = 'dark' | 'light' | 'system'
|
type Theme = 'dark' | 'light' | 'system'
|
||||||
type Language = 'en' | 'zh' | 'fr' | 'ar' | 'zh_TW'
|
type Language = 'en' | 'zh' | 'fr' | 'ar' | 'zh_TW'
|
||||||
|
|
@ -143,9 +142,11 @@ const useSettingsStoreBase = create<SettingsState>()(
|
||||||
setLanguage: (language: Language) => {
|
setLanguage: (language: Language) => {
|
||||||
set({ language })
|
set({ language })
|
||||||
// Update i18n after state is updated
|
// Update i18n after state is updated
|
||||||
if (i18n.language !== language) {
|
import('i18next').then(({ default: i18n }) => {
|
||||||
i18n.changeLanguage(language)
|
if (i18n.language !== language) {
|
||||||
}
|
i18n.changeLanguage(language)
|
||||||
|
}
|
||||||
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
setGraphLayoutMaxIterations: (iterations: number) =>
|
setGraphLayoutMaxIterations: (iterations: number) =>
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue