Make use of translationApi setting
This commit is contained in:
parent
289f341029
commit
eff0d76eae
|
@ -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;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
Loading…
Reference in a new issue