mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 06:45:58 +08:00
fix: webapp language (#2378)
This commit is contained in:
parent
556d1d0390
commit
65bec16fb3
@ -36,6 +36,7 @@ import type {
|
|||||||
} from '@/models/share'
|
} from '@/models/share'
|
||||||
import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'
|
import { addFileInfos, sortAgentSorts } from '@/app/components/tools/utils'
|
||||||
import { useToastContext } from '@/app/components/base/toast'
|
import { useToastContext } from '@/app/components/base/toast'
|
||||||
|
import { changeLanguage } from '@/i18n/i18next-config'
|
||||||
|
|
||||||
export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
||||||
const isInstalledApp = useMemo(() => !!installedAppInfo, [installedAppInfo])
|
const isInstalledApp = useMemo(() => !!installedAppInfo, [installedAppInfo])
|
||||||
@ -55,6 +56,11 @@ export const useChatWithHistory = (installedAppInfo?: InstalledApp) => {
|
|||||||
}, [isInstalledApp, installedAppInfo, appInfo])
|
}, [isInstalledApp, installedAppInfo, appInfo])
|
||||||
const appId = useMemo(() => appData?.app_id, [appData])
|
const appId = useMemo(() => appData?.app_id, [appData])
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (appData?.site.default_language)
|
||||||
|
changeLanguage(appData.site.default_language)
|
||||||
|
}, [appData])
|
||||||
|
|
||||||
const [conversationIdInfo, setConversationIdInfo] = useLocalStorageState<Record<string, string>>(CONVERSATION_ID_INFO, {
|
const [conversationIdInfo, setConversationIdInfo] = useLocalStorageState<Record<string, string>>(CONVERSATION_ID_INFO, {
|
||||||
defaultValue: {},
|
defaultValue: {},
|
||||||
})
|
})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user