Skip to content

Commit

Permalink
chore: update version 1.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Styx11 committed Jan 13, 2022
1 parent ec5cce2 commit ebe9fe6
Show file tree
Hide file tree
Showing 7 changed files with 70 additions and 730 deletions.
23 changes: 20 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -131,13 +131,30 @@ const transENResult = 'Hello, {name}'

```

🚨注意:因为百度翻译会将驼峰字符串转化为普通的字符串形式
⚠️注意:因为百度翻译会将驼峰字符串转化为普通的字符串形式
```ts
'totalPage'
// 👇
'totalpage'
```
所以我们目前只能把驼峰属性名改为普通的字符串形式或使用下划线
所以我们会统一将驼峰命名形式的参数转为下划线命名的形式
```ts
// 目标特殊文本
const message = '$=我说:{rawMessage: "你好"}'
// 👇
// 替换后的 react-intl 代码
const intl = intl.formatMessage({ id: "I_SAID_RAWMESSAGE" }, {raw_message: "你好"})

// 对应配置
// en_US
{
"I_SAID_RAWMESSAGE": "I said: {raw_message}"
}
// zh_CN
{
"I_SAID_RAWMESSAGE": "我说: {raw_message}"
}
```

## 配置
本插件提供了诸如国际化配置文件夹路径、国际化配置文件名称和不同框架下的国际化代码等配置项可供用户在 `settings.json` 文件下自定义:
Expand All @@ -154,7 +171,7 @@ reactIntlLinter.intlCode|`react-intl`\|`vue-i18n`|`react-intl`|目标国际化
修改配置后,你需要重启 VS Code

## Sponsor
由于我使用的翻译借口是需要收费的😅,所以如果这个插件你用的爽的话或许可以 Buy me a Coffee☕️
由于我使用的翻译接口是需要收费的😅,所以如果这个插件你用的爽的话或许可以 Buy me a Coffee☕️

![](https://s3.bmp.ovh/imgs/2021/12/ed04d7e65151baef.jpeg) ![](https://s3.bmp.ovh/imgs/2021/12/e21aa23150ba2e13.jpeg)

Expand Down
3 changes: 2 additions & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "client",
"displayName": "React-Intl-Linter - Client",
"version": "1.1.0",
"version": "1.1.1",
"description": "vscode linter extension for react-intl",
"repository": "git@github.com:Styx11/react-intl-linter.git",
"author": "styx11 <1654630248@qq.com>",
Expand All @@ -21,6 +21,7 @@
"dependencies": {
"axios": "^0.21.4",
"blueimp-md5": "^2.18.0",
"snake-case": "^3.0.4",
"uuid": "^8.3.2",
"vscode-languageclient": "^7.0.0"
}
Expand Down
36 changes: 36 additions & 0 deletions client/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,26 @@ concat-map@0.0.1:
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=

dot-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==
dependencies:
no-case "^3.0.4"
tslib "^2.0.3"

follow-redirects@^1.14.0:
version "1.14.3"
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e"
integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==

lower-case@^2.0.2:
version "2.0.2"
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28"
integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==
dependencies:
tslib "^2.0.3"

lru-cache@^6.0.0:
version "6.0.0"
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
Expand All @@ -66,13 +81,34 @@ minimatch@^3.0.4:
dependencies:
brace-expansion "^1.1.7"

no-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==
dependencies:
lower-case "^2.0.2"
tslib "^2.0.3"

semver@^7.3.4:
version "7.3.5"
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
dependencies:
lru-cache "^6.0.0"

snake-case@^3.0.4:
version "3.0.4"
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"
integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==
dependencies:
dot-case "^3.0.4"
tslib "^2.0.3"

tslib@^2.0.3:
version "2.3.1"
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==

uuid@^8.3.2:
version "8.3.2"
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"
Expand Down
12 changes: 6 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-intl-linter",
"version": "1.1.0",
"version": "1.1.1",
"publisher": "styx11",
"description": "vscode linter extension for react-intl",
"repository": "git@github.com:Styx11/react-intl-linter.git",
Expand Down Expand Up @@ -50,7 +50,10 @@
"reactIntlLinter.intlCode": {
"type": "string",
"default": "react-intl",
"enum": ["react-intl", "vue-i18n"],
"enum": [
"react-intl",
"vue-i18n"
],
"markdownDescription": "期望转换的国际化框架,支持 `react-intl`,`vue-i18n`。\n`react-intl` 对应代码为 `intl.formatMessage({id: ...})` ,`vueI18n` 对应代码为 `$t('id')`"
}
}
Expand All @@ -74,10 +77,7 @@
"@types/node": "^14.17.8",
"@typescript-eslint/parser": "^4.29.0",
"eslint": "^7.32.0",
"merge-options": "^3.0.4",
"rimraf": "^3.0.2",
"typescript": "^4.3.5",
"webpack": "^5.48.0",
"webpack-cli": "^4.7.2"
"typescript": "^4.3.5"
}
}
Binary file not shown.
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "server",
"version": "1.1.0",
"version": "1.1.1",
"description": "vscode linter extension for react-intl",
"repository": "git@github.com:Styx11/react-intl-linter.git",
"author": "styx11 <1654630248@qq.com>",
Expand Down
Loading

0 comments on commit ebe9fe6

Please sign in to comment.