Skip to content

Commit ebe9fe6

Browse files
committed
chore: update version 1.1.1
1 parent ec5cce2 commit ebe9fe6

File tree

7 files changed

+70
-730
lines changed

7 files changed

+70
-730
lines changed

README.md

Lines changed: 20 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -131,13 +131,30 @@ const transENResult = 'Hello, {name}'
131131

132132
```
133133

134-
🚨注意:因为百度翻译会将驼峰字符串转化为普通的字符串形式
134+
⚠️注意:因为百度翻译会将驼峰字符串转化为普通的字符串形式
135135
```ts
136136
'totalPage'
137137
// 👇
138138
'totalpage'
139139
```
140-
所以我们目前只能把驼峰属性名改为普通的字符串形式或使用下划线
140+
所以我们会统一将驼峰命名形式的参数转为下划线命名的形式
141+
```ts
142+
// 目标特殊文本
143+
const message = '$=我说:{rawMessage: "你好"}'
144+
// 👇
145+
// 替换后的 react-intl 代码
146+
const intl = intl.formatMessage({ id: "I_SAID_RAWMESSAGE" }, {raw_message: "你好"})
147+
148+
// 对应配置
149+
// en_US
150+
{
151+
"I_SAID_RAWMESSAGE": "I said: {raw_message}"
152+
}
153+
// zh_CN
154+
{
155+
"I_SAID_RAWMESSAGE": "我说: {raw_message}"
156+
}
157+
```
141158

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

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

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

client/package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "client",
33
"displayName": "React-Intl-Linter - Client",
4-
"version": "1.1.0",
4+
"version": "1.1.1",
55
"description": "vscode linter extension for react-intl",
66
"repository": "git@github.com:Styx11/react-intl-linter.git",
77
"author": "styx11 <1654630248@qq.com>",
@@ -21,6 +21,7 @@
2121
"dependencies": {
2222
"axios": "^0.21.4",
2323
"blueimp-md5": "^2.18.0",
24+
"snake-case": "^3.0.4",
2425
"uuid": "^8.3.2",
2526
"vscode-languageclient": "^7.0.0"
2627
}

client/yarn.lock

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,26 @@ concat-map@0.0.1:
4747
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
4848
integrity sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=
4949

50+
dot-case@^3.0.4:
51+
version "3.0.4"
52+
resolved "https://registry.yarnpkg.com/dot-case/-/dot-case-3.0.4.tgz#9b2b670d00a431667a8a75ba29cd1b98809ce751"
53+
integrity sha512-Kv5nKlh6yRrdrGvxeJ2e5y2eRUpkUosIW4A2AS38zwSz27zu7ufDwQPi5Jhs3XAlGNetl3bmnGhQsMtkKJnj3w==
54+
dependencies:
55+
no-case "^3.0.4"
56+
tslib "^2.0.3"
57+
5058
follow-redirects@^1.14.0:
5159
version "1.14.3"
5260
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.3.tgz#6ada78118d8d24caee595595accdc0ac6abd022e"
5361
integrity sha512-3MkHxknWMUtb23apkgz/83fDoe+y+qr0TdgacGIA7bew+QLBo3vdgEN2xEsuXNivpFy4CyDhBBZnNZOtalmenw==
5462

63+
lower-case@^2.0.2:
64+
version "2.0.2"
65+
resolved "https://registry.yarnpkg.com/lower-case/-/lower-case-2.0.2.tgz#6fa237c63dbdc4a82ca0fd882e4722dc5e634e28"
66+
integrity sha512-7fm3l3NAF9WfN6W3JOmf5drwpVqX78JtoGJ3A6W0a6ZnldM41w2fV5D490psKFTpMds8TJse/eHLFFsNHHjHgg==
67+
dependencies:
68+
tslib "^2.0.3"
69+
5570
lru-cache@^6.0.0:
5671
version "6.0.0"
5772
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
@@ -66,13 +81,34 @@ minimatch@^3.0.4:
6681
dependencies:
6782
brace-expansion "^1.1.7"
6883

84+
no-case@^3.0.4:
85+
version "3.0.4"
86+
resolved "https://registry.yarnpkg.com/no-case/-/no-case-3.0.4.tgz#d361fd5c9800f558551a8369fc0dcd4662b6124d"
87+
integrity sha512-fgAN3jGAh+RoxUGZHTSOLJIqUc2wmoBwGR4tbpNAKmmovFoWq0OdRkb0VkldReO2a2iBT/OEulG9XSUc10r3zg==
88+
dependencies:
89+
lower-case "^2.0.2"
90+
tslib "^2.0.3"
91+
6992
semver@^7.3.4:
7093
version "7.3.5"
7194
resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
7295
integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
7396
dependencies:
7497
lru-cache "^6.0.0"
7598

99+
snake-case@^3.0.4:
100+
version "3.0.4"
101+
resolved "https://registry.yarnpkg.com/snake-case/-/snake-case-3.0.4.tgz#4f2bbd568e9935abdfd593f34c691dadb49c452c"
102+
integrity sha512-LAOh4z89bGQvl9pFfNF8V146i7o7/CqFPbqzYgP+yYzDIDeS9HaNFtXABamRW+AQzEVODcvE79ljJ+8a9YSdMg==
103+
dependencies:
104+
dot-case "^3.0.4"
105+
tslib "^2.0.3"
106+
107+
tslib@^2.0.3:
108+
version "2.3.1"
109+
resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
110+
integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
111+
76112
uuid@^8.3.2:
77113
version "8.3.2"
78114
resolved "https://registry.yarnpkg.com/uuid/-/uuid-8.3.2.tgz#80d5b5ced271bb9af6c445f21a1a04c606cefbe2"

package.json

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-intl-linter",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"publisher": "styx11",
55
"description": "vscode linter extension for react-intl",
66
"repository": "git@github.com:Styx11/react-intl-linter.git",
@@ -50,7 +50,10 @@
5050
"reactIntlLinter.intlCode": {
5151
"type": "string",
5252
"default": "react-intl",
53-
"enum": ["react-intl", "vue-i18n"],
53+
"enum": [
54+
"react-intl",
55+
"vue-i18n"
56+
],
5457
"markdownDescription": "期望转换的国际化框架,支持 `react-intl`,`vue-i18n`。\n`react-intl` 对应代码为 `intl.formatMessage({id: ...})` ,`vueI18n` 对应代码为 `$t('id')`"
5558
}
5659
}
@@ -74,10 +77,7 @@
7477
"@types/node": "^14.17.8",
7578
"@typescript-eslint/parser": "^4.29.0",
7679
"eslint": "^7.32.0",
77-
"merge-options": "^3.0.4",
7880
"rimraf": "^3.0.2",
79-
"typescript": "^4.3.5",
80-
"webpack": "^5.48.0",
81-
"webpack-cli": "^4.7.2"
81+
"typescript": "^4.3.5"
8282
}
8383
}
Binary file not shown.

server/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "server",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "vscode linter extension for react-intl",
55
"repository": "git@github.com:Styx11/react-intl-linter.git",
66
"author": "styx11 <1654630248@qq.com>",

0 commit comments

Comments
 (0)