alibaba / kiwi Goto Github PK
View Code? Open in Web Editor NEW🐤 Kiwi-国际化翻译全流程解决方案
🐤 Kiwi-国际化翻译全流程解决方案
导出export-zh_TW,export-en_US;
不是应该是export-zh_CN?
Performance
vscode-i18n-linter
1.3.4
Darwin x64 18.7.0
1.36.1
/Users/cam/undefinedvs.vscode-i18n-linter-unresponsive.cpuprofile.txt
Find more details here: https://github.com/Microsoft/vscode/wiki/Explain:-extension-causes-high-cpu-load
一直报请配置googleApiKey
群二维码失效了,可否更新下
我们的翻译组定了一个方案是:
词语后面跟后缀来代表不同的状态,比如
i18n.xxxx.sure_btn
btn代表可以点击的按钮或链接,翻译组会根据这个翻译成 确定
i18n.xxxx.sure_msg
msg代表文案类,无法点击的,可能会翻译成肯定
以上只是一个例子,因为大部分情况翻译都有可能是交给第三方去翻译,而第三方并不会逐个去看你们的页面,所以这些后缀就起了比较关键的作用。
但我认为这个方案并不成熟,特别是**语言博大精深,现在我们定义一个量词也需要后面加_msg
,而且对于开发的心智负担会特别大
想咨询下阿里这边是否有比较好的方案或者规范
当然这个并不是这个项目的issues,如果觉得不合适可直接close
vscode-i18n-linter.i18nFilesPattern设置"default": "/src//.+(vue|js|html|ts*)"
kiwi --init kiwi --export导出的是已经定义的变量跟文案
未自定义中文变量情况下,需要一键抽取项目中所有的中文生成文件,提供给翻译人员,目前有这样的功能吗?未看到有快捷键、命令
老的文件默认是小写的
提取变量的时候,变量默认是大写,会导致不一致的问题
比如const text = `你有${nums}条消息`
在nums为1和不为1的时候翻译是不一致的,这种情况下翻译可能会不准确,希望针对这种情况增加提示,比如替换完成后生成一个kiwi-notice.txt文件,里面是收集到的是带变量模版字符串的位置,提示用户注意这里。
抽取国际化文本,生成国际化资源文件,框架无关,也支持自动翻译。
https://github.com/vue-viewer-editor/vve-i18n-cli
执行“kiwi --export”提示以下报错,请问是哪里出问题了,可以给一点提示吗?万分感谢!
TSError: ⨯ Unable to compile TypeScript: .kiwi/zh-CN/ChannelHeader.ts(2,23): error TS2304: Cannot find name \'exports\'. .kiwi/zh-CN/ChannelHeader.ts(3,1): error TS2304: Cannot find name 'exports'. at createTSError (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\ts-node\src\index.ts:261:12) at getOutput (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\ts-node\src\index.ts:367:40) at Object.compile (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\ts-node\src\index.ts:558:11) at Module.m._compile (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\ts-node\src\index.ts:439:43) at Module.m._compile (C:\Users\Administrator\AppData\Local\Yarn\Data\global\node_modules\ts-node\src\index.ts:439:23) at Module._extensions..js (module.js:663:10)
搭建了weblate翻译协作平台,可支持po,json,csv,yaml等格式,但是没有txt,选择了po格式也可以翻译txt的文件,但是下载下来就是po格式的文件了
如上,google翻译一直报错,还支持哪儿些翻译平台,加入了百度翻译key也不行,一直提示请配置googleApiKey
我在编辑 Vue 文件时发现如果 html 中出现了 
和  
时 kiwi-linter 会崩溃,标注中文功能会失效,只能关闭文件,重启 vs code。
不会导致该问题。
现在我是先注释掉  
,替换完之后再去掉注释
周围同事的visual环境里kiwi插件都识别不了中文;
另外,交流群二维码在哪里,能贴一个链接吗
vue 项目 ,cmd+ctrl+r 提示 command 'vscode-i18n-linter.findAllI18N' not found
vscode 插件用不了
本帖持续更新,大家产品中有使用 Kiwi
的麻烦留言,方便统计 Kiwi
的业务价值。
跟帖格式
产品名:
产品地址:
需要增加提示
(7,3): The class method 'changeLang' must be marked either 'private', 'public', or 'protected'
对于vue文件,安装了kiwi linter后,vscode-i18n-linter.i18nFilesPattern属性增加对vue的匹配,可以提取中文到语言配置表中,但是会提示I18N不存在,以及vue相应的取值语法是{{}},现在自动生成的是{},导致取不出值
问题:window系统下的插件运行会出错,希望增加对window文件系统的支持~
例子: kiwi-linter/extension.ts
下
/** 如果没有匹配到 Key */
if (!(suggestion && suggestion.length)) {
const names = currentFilename.split('/');
const fileName = _.last(names);
const fileKey = fileName
.split('.')[0]
.replace(new RegExp('-', 'g'), '_');
const dir = names[names.length - 2].replace(
new RegExp('-', 'g'),
'_'
);
if (dir === fileKey) {
suggestion = [dir];
} else {
suggestion = [dir, fileKey];
}
}
currentFilename.split('/')
这个不能分割window下的用\
分割目录结构,会报错
更新vscode版本至最新版本后插件无法正常启动
插件版本信息:
Name: kiwi-linter
Id: undefinedvs.vscode-i18n-linter
Description: A VSCode extension to identify and extract string literals for js(x)/ts(x) files
Version: 1.4.1
Publisher: undefinedvs
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=undefinedvs.vscode-i18n-linter
环境相关信息
Version: 1.60.0 (system setup)
Commit: e7d7e9a9348e6a8cc8c03f877d39cb72e5dfb1ff
Date: 2021-09-01T10:41:52.311Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Windows_NT x64 10.0.19043
我看作者已经把import的功能注释掉了,最近的更新也在9月份。期待作者有空的时候可以来完成这个特别优秀的作品。大声bb!!确实很棒
抽取为英文的时候 可以抽取为js 格式嘛 默认自动抽取为ts
业务组件单独以npm形式发布的,如何实现国际化?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.