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");
|
||||
btn.innerText = "Translate";
|
||||
btn.onclick = async (e) => {
|
||||
const t = await translate(content.innerText, "en", "es").catch(
|
||||
const t = await translate(content.innerText, "auto", "en").catch(
|
||||
console.error
|
||||
);
|
||||
if (t) content.innerText = t;
|
||||
|
|
Loading…
Reference in New Issue