@yxw007/translate 0.0.6 → 0.0.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -80,13 +80,13 @@ use jsDelivr CDN
80
80
 
81
81
  - `development`
82
82
  ```html
83
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.js"></script>
83
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.js"></script>
84
84
  ```
85
85
 
86
86
  - `production`
87
87
 
88
88
  ```html
89
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.min.js"></script>
89
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.min.js"></script>
90
90
  ```
91
91
 
92
92
  - example
@@ -97,7 +97,7 @@ use jsDelivr CDN
97
97
 
98
98
  <head>
99
99
  ...
100
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.js"></script>
100
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.js"></script>
101
101
  </head>
102
102
 
103
103
  <body>
@@ -160,7 +160,7 @@ translate(text: string | string[], options: TranslateOptions)
160
160
  export interface TranslateOptions {
161
161
  from: Language;
162
162
  to: Language;
163
- engine?: string;
163
+ engine?: Engines;
164
164
  /**
165
165
  * Cache time in milliseconds
166
166
  */
@@ -203,7 +203,7 @@ interface AmazonEngineOption extends BaseEngineOption{
203
203
 
204
204
  > Note: Option Param, please get it from the corresponding platform
205
205
 
206
- - Related documentationtive document:https://docs.aws.amazon.com/translate/latest/dg/what-is.html
206
+ - Related document:https://docs.aws.amazon.com/translate/latest/dg/what-is.html
207
207
  - Related library:https://www.npmjs.com/package/@aws-sdk/client-translate
208
208
 
209
209
  #### BaiduEngineOption
@@ -217,7 +217,19 @@ export interface BaiduEngineOption extends BaseEngineOption {
217
217
 
218
218
  > Note: Option Param, please get it from the corresponding platform
219
219
 
220
- - Related documentation:https://fanyi-api.baidu.com/product/121
220
+ - Related document:https://fanyi-api.baidu.com/product/121
221
+
222
+ #### DeeplEngineOption
223
+
224
+ ```typescript
225
+ export interface DeeplEngineOption {
226
+ key: string;
227
+ }
228
+ ```
229
+
230
+ > Note: Option Param, please get it from the corresponding platform
231
+
232
+ - Related document:https://www.deepl.com/en/your-account/keys
221
233
 
222
234
  ## 🤝 Contribute
223
235
 
@@ -269,6 +281,7 @@ export interface BaiduEngineOption extends BaseEngineOption {
269
281
  azure,
270
282
  amazon,
271
283
  baidu,
284
+ deepl,
272
285
  xx
273
286
  } as const;
274
287
  ```
package/README_zh-CN.md CHANGED
@@ -34,6 +34,7 @@ Translate 是一个支持多翻译引擎的翻译工具库,它提供了一套
34
34
  | azure translate | √ | 已投产,可以正常使用 |
35
35
  | amazon translate | √ | 已投产,可以正常使用 |
36
36
  | baidu | √ | 已投产,可以正常使用 |
37
+ | deepl | √ | 已投产,可以正常使用 |
37
38
  | yandex | | 由于我没有平台支持的银行账号,所以未调通(欢迎有条件的朋友帮忙调通,感谢) |
38
39
 
39
40
 
@@ -93,13 +94,13 @@ Translate 是一个支持多翻译引擎的翻译工具库,它提供了一套
93
94
 
94
95
  - `development`
95
96
  ```html
96
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.js"></script>
97
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.js"></script>
97
98
  ```
98
99
 
99
100
  - `production`
100
101
 
101
102
  ```html
102
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.min.js"></script>
103
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.min.js"></script>
103
104
  ```
104
105
 
105
106
  - example
@@ -110,7 +111,7 @@ Translate 是一个支持多翻译引擎的翻译工具库,它提供了一套
110
111
 
111
112
  <head>
112
113
  ...
113
- <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.1-alpha.3/dist/browser/index.umd.js"></script>
114
+ <script src="https://cdn.jsdelivr.net/npm/@yxw007/translate@0.0.7/dist/browser/index.umd.js"></script>
114
115
  </head>
115
116
 
116
117
  <body>
@@ -172,7 +173,7 @@ translate(text: string | string[], options: TranslateOptions)
172
173
  export interface TranslateOptions {
173
174
  from: Language;
174
175
  to: Language;
175
- engine?: string;
176
+ engine?: Engines;
176
177
  /**
177
178
  * Cache time in milliseconds
178
179
  */
@@ -231,6 +232,18 @@ export interface BaiduEngineOption extends BaseEngineOption {
231
232
 
232
233
  - 相关文档:https://fanyi-api.baidu.com/product/121
233
234
 
235
+ #### DeeplEngineOption
236
+
237
+ ```typescript
238
+ export interface DeeplEngineOption {
239
+ key: string;
240
+ }
241
+ ```
242
+
243
+ > 说明:option param 请从对应平台获取
244
+
245
+ - 相关文档:https://www.deepl.com/en/your-account/keys
246
+
234
247
  ## 🤝 贡献
235
248
 
236
249
  > 特别注意:请基于master创建一个新分支,在新分支上开发,开发完后创建PR至master
@@ -281,6 +294,7 @@ export interface BaiduEngineOption extends BaseEngineOption {
281
294
  azure,
282
295
  amazon,
283
296
  baidu,
297
+ deepl,
284
298
  xx
285
299
  } as const;
286
300
  ```