fix: some GitHub run action problem (#13991)
This commit is contained in:
parent
19d413ac1e
commit
66747a8eef
151 changed files with 5894 additions and 99 deletions
|
|
@ -30,10 +30,15 @@ async function translateMissingKeyDeeply(sourceObj, targetObject, toLanguage) {
|
|||
}
|
||||
else {
|
||||
try {
|
||||
if (!sourceObj[key]) {
|
||||
const source = sourceObj[key]
|
||||
if (!source) {
|
||||
targetObject[key] = ''
|
||||
return
|
||||
}
|
||||
// not support translate with '(' or ')'
|
||||
if (source.includes('(') || source.includes(')'))
|
||||
return
|
||||
|
||||
const { translation } = await translate(sourceObj[key], null, languageKeyMap[toLanguage])
|
||||
targetObject[key] = translation
|
||||
}
|
||||
|
|
@ -82,7 +87,12 @@ async function main() {
|
|||
|
||||
await Promise.all(files.map(async (file) => {
|
||||
await Promise.all(Object.keys(languageKeyMap).map(async (language) => {
|
||||
await autoGenTrans(file, language)
|
||||
try {
|
||||
await autoGenTrans(file, language)
|
||||
}
|
||||
catch (e) {
|
||||
console.error(`Error translating ${file} to ${language}`, e)
|
||||
}
|
||||
}))
|
||||
}))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue