fix(cli): 修复extract命令在nodejs<v15版本由于缺少replaceAll而不能工作的问题

This commit is contained in:
wxzhang 2023-03-28 17:09:06 +08:00
parent 280ac1186c
commit 719fdc4416
3 changed files with 7 additions and 41 deletions

View File

@ -1,38 +1 @@
{
"Voerkai1n是一个功能强大设计精良的国际化解决方案": {
"en": "Voerkai1n is a powerful and well-designed international solution",
"$file": [
"App.jsx"
]
},
"中华民族伟大复兴": {
"en": "The great rejuvenation of the Chinese nation",
"$file": [
"modules\\module1.js"
]
},
"犯我中华者,虽远必诛!": {
"en": "Those who violate China will be punished even if they are far away",
"$file": [
"modules\\module2.js"
]
},
"这是一个测试": {
"en": "This is test",
"$file": [
"App.jsx"
]
},
"一字一世界,一笔一乾坤,汉字是这个星球上最美的语言": {
"en": "Chinese characters are the most beautiful language on the planet",
"$file": [
"components\\Banner.jsx"
]
},
"当前语言": {
"en": "Current Language",
"$file": [
"components\\LanguageConfigurator.jsx"
]
}
}
{}

View File

@ -11,7 +11,8 @@ const path = require('path')
const fs = require('fs-extra')
const createLogger = require("logsets")
const { t } = require("./i18nProxy")
const replaceAll = require('string.prototype.replaceall');
replaceAll.shim()
const logger = createLogger()

View File

@ -21,9 +21,11 @@ program
banner.add("VoerkaI18n command line interactive tools",{style:"darkGray"})
banner.add()
banner.add("installed: {} latest: {}",[currentVersion,newVersion])
//if(!semver.gt(newVersion,currentVersion)){
if(!semver.gt(newVersion,currentVersion)){
banner.add("Run <{#yellow}> to upgrade","npm upgrade -g @voerkai18n/cli")
//}
}else{
banner.add("Run <{#yellow}> to upgrade","npm upgrade -g @voerkai18n/cli")
}
banner.render()
})