Serverless-Devs/core

i18n模块 移除

heimanba opened this issue · 3 comments

i18n模块,现在看来并无太大用处,现在只支持中文和英文,
可以尝试下面方法,获取当前语言

  1. 首先 从 ~/.s/set-config.yml获取语言
  2. https://www.npmjs.com/package/os-locale

先把readme 干掉

  • 我写了一个 脚本 去下载了devsapp下所有的仓库。搜索发现并未用到 core提供的i18n方法
  • 目前core里使用国际化的有
{
	"File unzipping...": "文件解压中...",
	"File decompression completed": "文件解压完成",
	"Add key-value pairs": "添加键值对",
	"End of adding key-value pairs": "结束添加键值对",
	"Please enter key": "请输入key",
	"Please enter value": "请输入value",
	"Alibaba Cloud": "阿里云",
	"Huawei Cloud": "华为云",
	"Baidu Cloud": "百度云",
	"Tencent Cloud": "腾讯云",
	"AWS": "AWS",
	"Azure": "Azure",
	"Google Cloud": "谷歌云",
	"Custom": "自定义",
	"Alibaba Cloud (alibaba)": "阿里云 (alibaba)",
	"Huawei Cloud (huawei)": "华为云 (huawei)",
	"Baidu Cloud (baidu)": "百度云 (baidu)",
	"Tencent Cloud (tencent)": "腾讯云 (tencent)",
	"AWS (aws)": "AWS (aws)",
	"Azure (azure)": "Azure (azure)",
	"Google Cloud (google)": "谷歌云 (google)",
	"Custom (custom)": "自定义 (custom)",
	"The current file does not exist": "当前文件不存在",
	"System exception": "系统异常",
	"文件下载中...": "文件下载中...",
	"download success": "download success"
}

个人建议: core里直接移除i18n方法,core里用i18n的地方直接用英文代替。

打包后的dist替换 ~/.s/cache/core/dist文件,测试

  • s init dk-http (jamstack-api, fc-deploy)
  • s init website-react (website)
    测试结果正常。