Make use of translationApi setting

This commit is contained in:
Bohdan Horbeshko 2023-10-30 11:37:59 +02:00
parent 289f341029
commit eff0d76eae
2 changed files with 3 additions and 2 deletions

View file

@ -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;
};

View file

@ -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,