From 8d6c1276f0d519227c25373e7701a1251249f02c Mon Sep 17 00:00:00 2001 From: Roy Li Date: Tue, 26 Jan 2021 20:47:05 +0800 Subject: [PATCH 01/18] docs: update --- README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.md b/README.md index 9545a9a..1aec3ed 100755 --- a/README.md +++ b/README.md @@ -22,6 +22,8 @@ ![](./assets/screenshot.png) +更详尽的使用文档请前往 [这里](https://www.notion.so/geekdada/Chrome-95ba478ceca745f8b98b4a1d06c0f8dd) + ## License [MIT](./LICENSE) From 3eee95aafb6543052a492734b806dba1907cb701 Mon Sep 17 00:00:00 2001 From: Roy Li Date: Sun, 14 Feb 2021 17:53:51 +0800 Subject: [PATCH 02/18] feat: remove support for a translator --- README.md | 4 +++- src/common/api.ts | 6 +----- src/common/types.ts | 2 +- src/pages/Options/Options.tsx | 23 ----------------------- 4 files changed, 5 insertions(+), 30 deletions(-) diff --git a/README.md b/README.md index 1aec3ed..cbc958d 100755 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # a-translator-chrome-extension +一个支持 DeepL 翻译的 Chrome 插件(需自己购买 DeepL API 计划)。 + ## 安装 ### Chrome Web Store @@ -14,7 +16,7 @@ ## 配置 -请在插件配置页面填入 A Translator 的 [API Token](https://a-translator.royli.dev/dashboard/profile)。 +请在插件配置页面填入 DeepL 的 API Token。 ## 使用 diff --git a/src/common/api.ts b/src/common/api.ts index d4d54a7..6bfa94f 100644 --- a/src/common/api.ts +++ b/src/common/api.ts @@ -49,12 +49,8 @@ class Client { private getAPI(): string { switch (this.region) { - case 'global': - return 'https://a-translator-api-cf.nerdynerd.org' - case 'dev': - return 'http://localhost:1337' default: - return 'https://a-translator-api.nerdynerd.org' + return 'https://api.deepl.com' } } } diff --git a/src/common/types.ts b/src/common/types.ts index 2a30ca9..fb563fd 100644 --- a/src/common/types.ts +++ b/src/common/types.ts @@ -11,7 +11,7 @@ export interface Config { export type SupportLanguageKeys = keyof typeof supportedLanguages -export type APIRegions = 'default' | 'global' | 'dev' +export type APIRegions = 'default' export type TranslateResult = { translations: Array<{ diff --git a/src/pages/Options/Options.tsx b/src/pages/Options/Options.tsx index 888b49a..e73517d 100644 --- a/src/pages/Options/Options.tsx +++ b/src/pages/Options/Options.tsx @@ -132,20 +132,6 @@ const Options: React.FC = () => { /> - - - -
@@ -188,15 +174,6 @@ const Options: React.FC = () => {