|
@@ -35,7 +35,7 @@ function isNumberRegex(str) {
|
|
|
} else if (timeRegex.test(str)) {
|
|
|
return true
|
|
|
} else {
|
|
|
- return false
|
|
|
+ return !!window.Vue_Translation_Of_Text_Old_Data[str]
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -47,9 +47,12 @@ function pushNewText(data) {
|
|
|
.then(response => {
|
|
|
if (response.data.code === 0) {
|
|
|
var obj = {}
|
|
|
+ var obj2 = {}
|
|
|
response.data.data.map(val => {
|
|
|
obj[val[0]] = val[1]
|
|
|
+ obj2[val[1]] = true
|
|
|
})
|
|
|
+ window.Vue_Translation_Of_Text_Old_Data = { ...(window.Vue_Translation_Of_Text_Old_Data || {}), ...obj2 }
|
|
|
window.Vue_Translation_Of_Text_Data = { ...(window.Vue_Translation_Of_Text_Data || {}), ...obj }
|
|
|
r({ ...obj })
|
|
|
}
|
|
@@ -208,11 +211,13 @@ export function translaBeforeRegistration(cb) {
|
|
|
})
|
|
|
.then(({ data }) => {
|
|
|
var obj = {}
|
|
|
+ var obj2 = {}
|
|
|
data?.data?.map(item => {
|
|
|
obj[item.source] = item.target
|
|
|
+ obj2[item.target] = true
|
|
|
})
|
|
|
+ window.Vue_Translation_Of_Text_Old_Data = { ...(window.Vue_Translation_Of_Text_Old_Data || {}), ...obj2 }
|
|
|
window.Vue_Translation_Of_Text_Data = { ...(window.Vue_Translation_Of_Text_Data || {}), ...obj }
|
|
|
- console.log(window.Vue_Translation_Of_Text_Data)
|
|
|
cb?.()
|
|
|
})
|
|
|
.catch(error => {
|