Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

271
Visualizações
Jquery.i18n not working when using a path of a json file

index.html

When i use jquery i18n plugin by giving the path of a json file its not working, it is printing the data-i18n value instead.

This is working

when i give the object here its working as i want.

I want to use the path method instead of writing the key-value pairs of translation objects inside html file

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

 $.i18n().load({
        'en': 'assets/i18n/en.json',
        'ar': 'assets/i18n/ar.json',
    }).done(function () {
        $('body').i18n();
    });

This made the code work. I think the translation should only take place after the json file is loaded.

The script is going to traverse all elements inside body and replace their contents with the messages under the provided translation keys. If the key cannot be found, the initial content will be displayed as a fallback. -- source -

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda