Skip to content

Commit 9113526

Browse files
fix: Fix default language when chat language is null (#2204)
* fix: Fix default language * fix: Fix default language when chat language is null --------- Co-authored-by: wangdan-fit2cloud <dan.wang@fit2cloud.com>
1 parent 9937b61 commit 9113526

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/views/chat/index.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import useStore from '@/stores'
2525
import Auth from '@/views/chat/auth/index.vue'
2626
import { hexToRgba } from '@/utils/theme'
2727
import { useI18n } from 'vue-i18n'
28+
import { getBrowserLang } from '@/locales/index'
2829
const { locale } = useI18n({ useScope: 'global' })
2930
const route = useRoute()
3031
const { application, user } = useStore()
@@ -80,7 +81,7 @@ const init_data_end = ref<boolean>(false)
8081
const applicationAvailable = ref<boolean>(true)
8182
function getAppProfile() {
8283
return application.asyncGetAppProfile(loading).then((res: any) => {
83-
locale.value = res.data?.language
84+
locale.value = res.data?.language || getBrowserLang()
8485
show_history.value = res.data?.show_history
8586
application_profile.value = res.data
8687
})

0 commit comments

Comments
 (0)