-
Notifications
You must be signed in to change notification settings - Fork 250
feat: 修复jest单元测试,并新增当全部翻译插件失效时,取中文首字母拼音作为translate #377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
#377 关联Issue |
| getFullChars: function (str) { | ||
| let result = '', | ||
| name; | ||
| // let reg = new RegExp('[a-zA-Z0-9- ]'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
整理一下代码,没用的注释删掉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好的
| for (let key in this.full_dict) { | ||
| if (-1 !== this.full_dict[key].indexOf(str)) { | ||
| return this._capitalize(key); | ||
| break; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return后面的break没用吧?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是的,这个break无用
|
@z979054461 已去除无用注释,谢谢 |
|
你单独提一下pinyin好了,单元测试我来修 |
|
@z979054461 已去除单元测试的修复,仅上次pinyin代码,谢谢 |
What kind of change does this PR introduce(这个 PR 引入了什么样的变化)?
Does this PR introduce a breaking change(这次 PR 引入了一个重大变化吗)?
If yes, please describe the impact and migration path for existing applications(如果是,请描述现有应用程序的影响和迁移路径):
The PR fulfills these requirements(PR 符合以下要求)
Other information(其他信息)
修复了单元测试引用路径问题,个人觉得依赖外部插件作为翻译有风险,应当在最后的选项提供一个默认的(比如取中文首字母)的方案作为不报错的备用方案,否则在使用Vs-code插件的时候,排查错误比较困难。