Skip to content
This repository was archived by the owner on Aug 16, 2024. It is now read-only.

Commit 3eee95a

Browse files
committed
feat: remove support for a translator
1 parent 8d6c127 commit 3eee95a

File tree

4 files changed

+5
-30
lines changed

4 files changed

+5
-30
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# a-translator-chrome-extension
22

3+
一个支持 DeepL 翻译的 Chrome 插件(需自己购买 DeepL API 计划)。
4+
35
## 安装
46

57
### Chrome Web Store
@@ -14,7 +16,7 @@
1416

1517
## 配置
1618

17-
请在插件配置页面填入 A Translator 的 [API Token](https://a-translator.royli.dev/dashboard/profile)
19+
请在插件配置页面填入 DeepL 的 API Token。
1820

1921
## 使用
2022

src/common/api.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,8 @@ class Client {
4949

5050
private getAPI(): string {
5151
switch (this.region) {
52-
case 'global':
53-
return 'https://a-translator-api-cf.nerdynerd.org'
54-
case 'dev':
55-
return 'http://localhost:1337'
5652
default:
57-
return 'https://a-translator-api.nerdynerd.org'
53+
return 'https://api.deepl.com'
5854
}
5955
}
6056
}

src/common/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export interface Config {
1111

1212
export type SupportLanguageKeys = keyof typeof supportedLanguages
1313

14-
export type APIRegions = 'default' | 'global' | 'dev'
14+
export type APIRegions = 'default'
1515

1616
export type TranslateResult = {
1717
translations: Array<{

src/pages/Options/Options.tsx

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -132,20 +132,6 @@ const Options: React.FC = () => {
132132
/>
133133
</OptionSection>
134134

135-
<OptionSection title={'API 地区'}>
136-
<select
137-
tw="px-4 py-3 rounded-md"
138-
name="region"
139-
value={region}
140-
onChange={(e) => setRegion(e.target.value as APIRegions)}>
141-
<option value="default">默认</option>
142-
<option value="global">全球(非亚洲地区)</option>
143-
{process.env.NODE_ENV !== 'production' ? (
144-
<option value="dev">DEV</option>
145-
) : undefined}
146-
</select>
147-
</OptionSection>
148-
149135
<OptionSection title={'腾讯云 OCR'}>
150136
<div tw="space-y-3">
151137
<div>
@@ -188,15 +174,6 @@ const Options: React.FC = () => {
188174

189175
<OptionSection title={'🔗 相关链接'}>
190176
<ul tw="space-y-2">
191-
<li>
192-
<a
193-
tw="text-blue-600 cursor-pointer"
194-
href="https://a-translator.royli.dev/dashboard"
195-
target="_blank"
196-
rel="noreferrer">
197-
→ 后台
198-
</a>
199-
</li>
200177
<li>
201178
<a
202179
tw="text-blue-600 cursor-pointer"

0 commit comments

Comments
 (0)