mirror of
https://github.com/chinayangxiaowei/marktext-chinese-language-pack.git
synced 2025-05-02 22:49:34 +08:00
Output an error message when the translation fails.
This commit is contained in:
parent
be1d0c9a21
commit
2b7a5e8cbe
@ -16,7 +16,7 @@ function doTranslate() {
|
||||
if (process.env['lang']){
|
||||
toLang = process.env['lang']
|
||||
}
|
||||
if (toLang == '') return
|
||||
if (toLang == '') return true
|
||||
require('ts-node/register')
|
||||
const { markTextAsarTranslate } = require('../marktext_asar_translate')
|
||||
console.log(process.env['lang'])
|
||||
@ -26,7 +26,7 @@ function doTranslate() {
|
||||
const outMainJsFileName = path.join(jsRootPath, './main.js')
|
||||
const rendererJsFileName = path.join(jsRootPath, './renderer.js')
|
||||
const outRendererJsFileName = path.join(jsRootPath, './renderer.js')
|
||||
markTextAsarTranslate(longRootPath, toLang, mainJsFileName, outMainJsFileName, rendererJsFileName, outRendererJsFileName)
|
||||
return markTextAsarTranslate(longRootPath, toLang, mainJsFileName, outMainJsFileName, rendererJsFileName, outRendererJsFileName)
|
||||
}
|
||||
|
||||
|
||||
@ -99,7 +99,9 @@ async function build () {
|
||||
.then(() => {
|
||||
|
||||
console.log('do translate process')
|
||||
doTranslate()
|
||||
if (!doTranslate()){
|
||||
process.exit(1)
|
||||
}
|
||||
|
||||
process.stdout.write('\x1B[2J\x1B[0f')
|
||||
console.log(`\n\n${results}`)
|
||||
|
Loading…
Reference in New Issue
Block a user