File tree Expand file tree Collapse file tree 5 files changed +17
-12
lines changed
locales/lang/en-US/components Expand file tree Collapse file tree 5 files changed +17
-12
lines changed Original file line number Diff line number Diff line change 1+ export default {
2+ createChat : 'Create Chat' ,
3+ history : 'History record'
4+ }
Original file line number Diff line number Diff line change 1-
1+ import chat from './ai-chat'
22export default {
3-
4- } ;
3+ chat ,
4+ }
Original file line number Diff line number Diff line change @@ -4,12 +4,10 @@ import applicationXpackApi from '@/api/application-xpack'
44import { type Ref } from 'vue'
55
66import useUserStore from './user'
7-
87const useApplicationStore = defineStore ( {
98 id : 'application' ,
109 state : ( ) => ( {
11- location : `${ window . location . origin } /ui/chat/` ,
12- userLanguage : ''
10+ location : `${ window . location . origin } /ui/chat/`
1311 } ) ,
1412 actions : {
1513 async asyncGetAllApplication ( ) {
@@ -80,9 +78,10 @@ const useApplicationStore = defineStore({
8078 return new Promise ( ( resolve , reject ) => {
8179 applicationApi
8280 . getAppProfile ( loading )
83- . then ( ( data ) => {
84- this . userLanguage = data . data ?. language
85- resolve ( data )
81+ . then ( ( res ) => {
82+ sessionStorage . setItem ( 'language' , res . data ?. language )
83+
84+ resolve ( res )
8685 } )
8786 . catch ( ( error ) => {
8887 reject ( error )
Original file line number Diff line number Diff line change @@ -33,10 +33,9 @@ const useUserStore = defineStore({
3333 } ) ,
3434 actions : {
3535 getLanguage ( ) {
36- const application = useApplicationStore ( )
3736 return this . userType === 1
38- ? this . userInfo ?. language || localStorage . getItem ( 'MaxKB-locale' )
39- : application ?. userLanguage
37+ ? localStorage . getItem ( 'MaxKB-locale' )
38+ : sessionStorage . getItem ( 'language' )
4039 } ,
4140 showXpack ( ) {
4241 return this . isXPack
Original file line number Diff line number Diff line change @@ -24,6 +24,8 @@ import { useRoute } from 'vue-router'
2424import useStore from ' @/stores'
2525import Auth from ' @/views/chat/auth/index.vue'
2626import { hexToRgba } from ' @/utils/theme'
27+ import { useI18n } from ' vue-i18n'
28+ const { locale } = useI18n ({ useScope: ' global' })
2729const route = useRoute ()
2830const { application, user } = useStore ()
2931
@@ -78,6 +80,7 @@ const init_data_end = ref<boolean>(false)
7880const applicationAvailable = ref <boolean >(true )
7981function getAppProfile() {
8082 return application .asyncGetAppProfile (loading ).then ((res : any ) => {
83+ locale .value = res .data ?.language
8184 show_history .value = res .data ?.show_history
8285 application_profile .value = res .data
8386 })
You can’t perform that action at this time.
0 commit comments