提交 584ec63d 编写于 作者: fxy060608's avatar fxy060608

chore(cli): i18n

上级 fc45c4f2
......@@ -49,6 +49,7 @@
"merge": "^2.1.1",
"mime": "^3.0.0",
"module-alias": "^2.2.2",
"os-locale-s-fix": "^1.0.8-fix-1",
"picocolors": "^1.0.0",
"postcss-import": "^14.0.2",
"postcss-load-config": "^3.1.1",
......
export default {
'app.compiler.version': 'Compiler version: {version}',
compiling: 'Compiling...',
'dev.performance':
'Please note that in running mode, due to log output, sourcemap, and uncompressed source code, the performance and package size are not as good as release mode.',
'dev.performance.nvue':
'Especially the sourcemap of app-nvue has a greater impact',
'dev.performance.mp':
'To officially release, please click the release menu or use the cli release command to release',
'build.done': 'DONE Build complete.',
'dev.watching.start': 'Compiling...',
'dev.watching.end': 'DONE Build complete. Watching for changes...',
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
'stat.warn.appid':
'The current application is not configured with Appid, and uni statistics cannot be used. For details, see https://ask.dcloud.net.cn/article/36303',
'stat.warn.version':
'The uni statistics version is not configured. The default version is 1.0.uni statistics version 2.0 is recommended, private deployment data is more secure and code is open source and customizable. details: https://uniapp.dcloud.io/uni-stat',
'stat.warn.tip': 'uni statistics version: {version}',
'i18n.fallbackLocale.default':
'fallbackLocale is missing in manifest.json, use: {locale}',
'i18n.fallbackLocale.missing': './local/{locale}.json is missing',
'easycom.conflict': 'easycom component conflict: ',
'mp.component.args[0]': 'The first parameter of {0} must be a static string',
'mp.component.args[1]': '{0} requires two parameters',
'mp.360.unsupported': '360 is unsupported',
'file.notfound': '{file} is not found',
} as const
export const M = {
'app.compiler.version': '编译器版本:{version}',
compiling: '正在编译中...',
'dev.performance':
'请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。',
'dev.performance.nvue': '尤其是 app-nvue 的 sourcemap 影响较大',
'dev.performance.mp':
'若要正式发布,请点击发行菜单或使用 cli 发布命令进行发布',
'build.done': 'DONE Build complete.',
'dev.watching.start': '开始差量编译...',
'dev.watching.end': 'DONE Build complete. Watching for changes...',
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
'stat.warn.appid':
'当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
'stat.warn.version':
'当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat',
'stat.warn.tip': '已开启 uni统计{version} 版本',
'i18n.fallbackLocale.default':
'当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}',
'i18n.fallbackLocale.missing':
'当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件',
'easycom.conflict': 'easycom组件冲突:',
'mp.component.args[0]': '{0}的第一个参数必须为静态字符串',
'mp.component.args[1]': '{0}需要两个参数',
'mp.360.unsupported': 'vue3暂不支持360小程序',
'file.notfound': '{file} 文件不存在',
} as const
import { osLocale } from 'os-locale-s-fix'
import en from './en'
import zh_CN from './zh_CN'
function format(lang: string) {
const array = lang.split(/[.,]/)[0].split(/[_-]/)
array[0] = array[0].toLowerCase()
if (array[0] === 'zh') {
array[1] = (array[1] || 'CN').toUpperCase()
}
array.length = Math.min(array.length, 2)
return array.join('_')
}
const locale = format(
process.env.UNI_HBUILDERX_LANGID ||
osLocale.sync({ spawn: true, cache: false }) ||
'en'
)
export const M = locale === 'zh_CN' ? zh_CN : en
export default {
'app.compiler.version': '编译器版本:{version}',
compiling: '正在编译中...',
'dev.performance':
'请注意运行模式下,因日志输出、sourcemap 以及未压缩源码等原因,性能和包体积,均不及发行模式。',
'dev.performance.nvue': '尤其是 app-nvue 的 sourcemap 影响较大',
'dev.performance.mp':
'若要正式发布,请点击发行菜单或使用 cli 发布命令进行发布',
'build.done': 'DONE Build complete.',
'dev.watching.start': '开始差量编译...',
'dev.watching.end': 'DONE Build complete. Watching for changes...',
'dev.watching.end.pages': 'DONE Build complete. PAGES:{pages}',
'dev.watching.end.files': 'DONE Build complete. FILES:{files}',
'stat.warn.appid':
'当前应用未配置 appid,无法使用 uni 统计,详情参考:https://ask.dcloud.net.cn/article/36303',
'stat.warn.version':
'当前应用未配置uni统计版本,默认使用1.0版本;建议使用uni统计2.0版本 ,私有部署数据更安全,代码开源可定制。详情:https://uniapp.dcloud.io/uni-stat',
'stat.warn.tip': '已开启 uni统计{version} 版本',
'i18n.fallbackLocale.default':
'当前应用未在 manifest.json 配置 fallbackLocale,默认使用:{locale}',
'i18n.fallbackLocale.missing':
'当前应用配置的 fallbackLocale 或 locale 为:{locale},但 locale 目录缺少该语言文件',
'easycom.conflict': 'easycom组件冲突:',
'mp.component.args[0]': '{0}的第一个参数必须为静态字符串',
'mp.component.args[1]': '{0}需要两个参数',
'mp.360.unsupported': 'vue3暂不支持360小程序',
'file.notfound': '{file} 文件不存在',
} as const
......@@ -338,6 +338,7 @@ importers:
merge: ^2.1.1
mime: ^3.0.0
module-alias: ^2.2.2
os-locale-s-fix: ^1.0.8-fix-1
picocolors: ^1.0.0
postcss: ^8.4.13
postcss-import: ^14.0.2
......@@ -380,6 +381,7 @@ importers:
merge: 2.1.1
mime: 3.0.0
module-alias: 2.2.2
os-locale-s-fix: 1.0.8-fix-1
picocolors: 1.0.0
postcss-import: 14.1.0_postcss@8.4.14
postcss-load-config: 3.1.4_postcss@8.4.14
......@@ -5400,7 +5402,6 @@ packages:
/invert-kv/3.0.1:
resolution: {integrity: sha512-CYdFeFexxhv/Bcny+Q0BfOV+ltRlJcd4BBZBYFX/O0u4npJrgZtIcjokegtiSMAvlMTJ+Koq0GBCc//3bueQxw==}
engines: {node: '>=8'}
dev: true
/ipaddr.js/1.9.1:
resolution: {integrity: sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==}
......@@ -6216,7 +6217,6 @@ packages:
engines: {node: '>=8'}
dependencies:
invert-kv: 3.0.1
dev: true
/level-blobs/0.1.7:
resolution: {integrity: sha512-n0iYYCGozLd36m/Pzm206+brIgXP8mxPZazZ6ZvgKr+8YwOZ8/PPpYC5zMUu2qFygRN8RO6WC/HH3XWMW7RMVg==}
......@@ -6783,7 +6783,6 @@ packages:
engines: {node: '>=10', yarn: ^1.22.4}
dependencies:
lcid: 3.1.1
dev: true
/ospath/1.2.2:
resolution: {integrity: sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册