From eff0d76eae23d628a13045d4269f638b27e9b355 Mon Sep 17 00:00:00 2001 From: Bohdan Horbeshko Date: Mon, 30 Oct 2023 11:37:59 +0200 Subject: [PATCH] Make use of translationApi setting --- src/content/components/TranslateContainer.js | 3 ++- src/popup/components/PopupPage.js | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/content/components/TranslateContainer.js b/src/content/components/TranslateContainer.js index 911e82e..a9badc8 100644 --- a/src/content/components/TranslateContainer.js +++ b/src/content/components/TranslateContainer.js @@ -7,7 +7,8 @@ import TranslatePanel from "./TranslatePanel"; import "../styles/TranslateContainer.scss"; const translateText = async (text, targetLang = getSettings("targetLang")) => { - const result = await translate(text, "auto", targetLang); + const translationApi = getSettings("translationApi"); + const result = await translate(text, "auto", targetLang, translationApi); return result; }; diff --git a/src/popup/components/PopupPage.js b/src/popup/components/PopupPage.js index 4929f7e..6b29685 100644 --- a/src/popup/components/PopupPage.js +++ b/src/popup/components/PopupPage.js @@ -124,7 +124,7 @@ export default class PopupPage extends Component { translateText = async (text, targetLang) => { log.info(logDir, "translateText()", text, targetLang); - const result = await translate(text, "auto", targetLang); + const result = await translate(text, "auto", targetLang, this.state.translationApi); this.setState({ resultText: result.resultText, rawHTML: result.rawHTML,