Hi, I’m trying to change the inner text of an HTML element using a script. I’m getting the value from a JSON object as i18n keys, but when I set the value in HTML, it displays the i18n keys instead of the translated text.
script:
if (testimonial) {
document.querySelectorAll('.testimonial-name').forEach(nameElement => nameElement.innerText = testimonial.customerName);
document.querySelectorAll('.testimonial-position').forEach(positionElement => positionElement.innerText = testimonial.companyName);
document.querySelectorAll('.testimonial-description').forEach(descriptionElement => descriptionElement.innerText = testimonial.testimony);
}