Detect language
This commit is contained in:
parent
cec84c29b0
commit
b4354a9fdb
@ -59,7 +59,7 @@ const sleep = (ms) => new Promise((r) => setTimeout(r, ms));
|
|||||||
const btn = document.createElement("button");
|
const btn = document.createElement("button");
|
||||||
btn.innerText = "Translate";
|
btn.innerText = "Translate";
|
||||||
btn.onclick = async (e) => {
|
btn.onclick = async (e) => {
|
||||||
const t = await translate(content.innerText, "en", "es").catch(
|
const t = await translate(content.innerText, "auto", "en").catch(
|
||||||
console.error
|
console.error
|
||||||
);
|
);
|
||||||
if (t) content.innerText = t;
|
if (t) content.innerText = t;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user