Skip to content

Commit 655526b

Browse files
committed
feat: rename api
1 parent 507549f commit 655526b

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717
- `formality` 正式程度: 设置翻译后的文本是倾向于正式语言还是非正式语言。此功能目前适用于所有目标语言,除了英语、英式英语、美式英语、西班牙语、汉语和日语。
1818

19-
## Sub DeepL
19+
## A Translator
2020

21-
每个月最少 2.5 美元即可使用 DeepL API,详情请见 [sub-deepl.royli.dev](https://sub-deepl.royli.dev?utm_source=github&utm_medium=readme)
21+
每个月最少 20 港币即可使用 DeepL 翻译服务,详情请见 [a-translator.royli.dev](https://a-translator.royli.dev?utm_source=github&utm_medium=readme)
2222

2323
## 注意
2424

scripts/bundle.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ function generateInfo() {
3232
value: 'deepl',
3333
},
3434
{
35-
title: 'Sub DeepL',
36-
value: 'sub-deepl',
35+
title: 'A Translator',
36+
value: 'a-translator',
3737
},
3838
...(process.env.NODE_ENV === 'development'
3939
? [

src/api.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@ import { RequestCallbackResponse, RequestObject } from '../types/global'
22

33
export class Api {
44
constructor(
5-
private provider: 'deepl' | 'sub-deepl' | 'local',
5+
private provider: 'deepl' | 'a-translator' | 'local',
66
private token: string,
77
) {}
88

99
private get baseUrl(): string {
1010
switch (this.provider) {
1111
case 'deepl':
1212
return 'https://api.deepl.com'
13-
case 'sub-deepl':
14-
return 'https://sub-deepl-api.nerdynerd.org'
13+
case 'a-translator':
14+
return 'https://a-translator-api.nerdynerd.org'
1515
case 'local':
1616
return 'http://localhost:1337'
1717
}

types/global.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export interface RequestCallbackResponse<T = Record<string, unknown>> {
5151

5252
interface $option {
5353
token: string
54-
provider: 'deepl' | 'sub-deepl' | 'local'
54+
provider: 'deepl' | 'a-translator' | 'local'
5555
formality: 'default' | 'more' | 'less'
5656
}
5757

0 commit comments

Comments
 (0)