Feature(custom): split i18n in main and renderer, use vue-i18n

This commit is contained in:
Kuingsmile
2025-08-01 13:10:05 +08:00
parent ff95e0f6fe
commit 236b7c6e7d
76 changed files with 4310 additions and 5986 deletions

View File

@@ -1,22 +0,0 @@
import pkg from 'root/package.json'
import { handleTalkingDataEvent } from '@/utils/common'
import { TALKING_DATA_APPID, TALKING_DATA_EVENT } from '#/events/constants'
import { ITalkingDataOptions } from '#/types/types'
const { version } = pkg
export const initTalkingData = () => {
setTimeout(() => {
const talkingDataScript = document.createElement('script')
talkingDataScript.src = `http://sdk.talkingdata.com/app/h5/v1?appid=${TALKING_DATA_APPID}&vn=${version}&vc=${version}`
const head = document.getElementsByTagName('head')[0]
head.appendChild(talkingDataScript)
}, 0)
}
window.electron.ipcRendererOn(TALKING_DATA_EVENT, (_, data: ITalkingDataOptions) => {
handleTalkingDataEvent(data)
})

View File

@@ -1,17 +1,5 @@
import { isReactive, isRef, toRaw, unref } from 'vue'
import { ITalkingDataOptions } from '#/types/types'
export const handleTalkingDataEvent = (data: ITalkingDataOptions) => {
try {
const { EventId, Label = '', MapKv = {} } = data
MapKv.from = window.location.href
window.TDAPP.onEvent(EventId, Label, MapKv)
} catch (e) {
console.error(e)
}
}
/**
* get raw data from reactive or ref
*/

View File

@@ -1,5 +1,4 @@
import { IRPCActionType } from 'root/src/universal/types/enum'
import { IRPCActionType } from '#/types/enum'
import { IObj } from '#/types/types'
export function saveConfig (config: IObj | string, value?: any) {

View File

@@ -1,14 +0,0 @@
import { ILogType, IRPCActionType } from '#/types/enum'
export const deleteLog = (fileName?: string, type?: string, isSuccess = true, msg?: string) => {
window.electron.sendRPC(
IRPCActionType.GALLERY_LOG_DELETE_MSG,
msg || `Delete ${fileName} on ${type} success`,
isSuccess ? ILogType.success : ILogType.error
)
}
export const deleteFailedLog = (fileName: string, type: string, error: any) => {
deleteLog(fileName, type, false)
window.electron.sendRPC(IRPCActionType.GALLERY_LOG_DELETE_MSG, error, ILogType.error)
}