Feature(custom): update i18n force update

This commit is contained in:
Kuingsmile
2024-06-13 11:13:58 +08:00
parent 5ddc182bd1
commit e9c386d5d8
14 changed files with 54 additions and 91 deletions

View File

@@ -6,7 +6,7 @@ import windowManager from 'apis/app/window/windowManager'
import { i18nManager } from '~/i18n'
import { IRPCActionType, IWindowList } from '#/types/enum'
import { GET_CURRENT_LANGUAGE, GET_LANGUAGE_LIST, SET_CURRENT_LANGUAGE } from '#/events/constants'
import { SET_CURRENT_LANGUAGE } from '#/events/constants'
export default [
{
@@ -31,14 +31,14 @@ export default [
{
action: IRPCActionType.GET_LANGUAGE_LIST,
handler: async (event: IIPCEvent) => {
event.sender.send(GET_LANGUAGE_LIST, i18nManager.languageList)
event.returnValue = i18nManager.languageList
}
},
{
action: IRPCActionType.GET_CURRENT_LANGUAGE,
handler: async (event: IIPCEvent) => {
const { lang, locales } = i18nManager.getCurrentLocales()
event.sender.send(GET_CURRENT_LANGUAGE, lang, locales)
event.returnValue = [lang, locales]
}
},
{