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"; import "../styles/TranslateContainer.scss";
const translateText = async (text, targetLang = getSettings("targetLang")) => { 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; return result;
}; };

View file

@ -124,7 +124,7 @@ export default class PopupPage extends Component {
translateText = async (text, targetLang) => { translateText = async (text, targetLang) => {
log.info(logDir, "translateText()", 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({ this.setState({
resultText: result.resultText, resultText: result.resultText,
rawHTML: result.rawHTML, rawHTML: result.rawHTML,