22 <DrawerPro v-model =" drawerVisible " :header =" $t (' commons.button.upgrade' )" @close =" handleClose " size="large">
33 <div class =" panel-MdEditor" >
44 <div class =" default-theme" >
5- <h2 class =" inline-block" >{{ $t('app.version') }}</h2 >
5+ <h2 class =" inline-block" >{{ versionTitle }}</h2 >
66 </div >
77 <el-radio-group class =" inline-block tag" v-model =" upgradeVersion" @change =" changeOption" >
88 <el-radio v-if =" upgradeInfo.newVersion" :value =" upgradeInfo.newVersion" >
3232import MarkDownEditor from ' @/components/mkdown-editor/index.vue' ;
3333
3434import { loadReleaseNotes , upgrade } from ' @/api/modules/setting' ;
35- import i18n from ' @/lang' ;
35+ import i18n , { loadLocaleMessages } from ' @/lang' ;
3636import { MsgSuccess } from ' @/utils/message' ;
37- import { ref } from ' vue' ;
37+ import { computed , ref } from ' vue' ;
3838import { useGlobalStore } from ' @/composables/useGlobalStore' ;
3939import { ElMessageBox } from ' element-plus' ;
4040
41- const { isLoading, isOnRestart } = useGlobalStore ();
41+ const { isLoading, isOnRestart, isIntl } = useGlobalStore ();
42+
43+ const releaseNotesLocale = computed (() => (isIntl .value ? ' en' : ' zh' ));
44+ const versionTitle = computed (() => i18n .global .t (' app.version' , {}, { locale: releaseNotesLocale .value }));
4245
4346const drawerVisible = ref (false );
4447const upgradeInfo = ref ();
@@ -49,7 +52,8 @@ interface DialogProps {
4952 upgradeInfo: number ;
5053 upgradeVersion: string ;
5154}
52- const acceptParams = (params : DialogProps ): void => {
55+ const acceptParams = async (params : DialogProps ): Promise <void > => {
56+ await loadLocaleMessages (releaseNotesLocale .value );
5357 upgradeInfo .value = params .upgradeInfo ;
5458 upgradeVersion .value = params .upgradeVersion ;
5559 drawerVisible .value = true ;
0 commit comments