I18n Keys in JS

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);

}

How is this related to Hugo?

If it possible to convert this key to respect language .

When your JavaScript runs, Hugo is much out of the picture. In any case, your description is lacking too much detail to understand what you’re doing.