|
|
|
@ -1,10 +1,10 @@
|
|
|
|
|
function hideText(request) {
|
|
|
|
|
document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'hidden')
|
|
|
|
|
document.querySelectorAll(".translationText, .romanizationText").forEach(element => element.style.visibility = 'hidden')
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function updateTranslations(response) {
|
|
|
|
|
const translations = JSON.parse(response);
|
|
|
|
|
document.querySelectorAll(".languageText").forEach(element => {
|
|
|
|
|
document.querySelectorAll(".translationText").forEach(element => {
|
|
|
|
|
element.textContent = translations[element.id.replace("Text", "")];
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -28,6 +28,6 @@ function updateTranslations(response) {
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
// Show elements again
|
|
|
|
|
document.querySelectorAll(".languageText, .romanizationText").forEach(element => element.style.visibility = 'visible')
|
|
|
|
|
document.querySelectorAll(".translationText, .romanizationText").forEach(element => element.style.visibility = 'visible')
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|