JSFiddle - React, Tailwind, and code Playground
by Outrora
HTML
<div class="title translate-text">
What is this ?
<h1>This is a real nice title</h1>
</div>
<div class="body translate-all">
<p>Here we have the main subject of this page man!</p>
</div>
<div class="foot translate-all">
<p>Foots are used to have ads on it, so no one cares</p>
</div>
JavaScript
let pendences = []
function getTextsToTranslate() {
let text = document.querySelectorAll('.translate-text')
let all = document.querySelectorAll('.translate-all')
console.log(text[0].innerText)
}
const TEXTS = {
t: {
i: [
'This is a real nice title',
'This is a title'
]
},
h: {
w: [
'Here we have the main subject of this page man!'
]
},
f: {
a: [
'Foots are used to have ads on it, so one one cares'
]
}
}