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

268
Visualizações
ngx-translate .instant() doesn't load is not instant

I translate data that I get locally, they are not async data.

My native text comes from an enum imported in my file V2VehiculeOutput.StatusEnum

But I am forced to reload the page if I want to see the translation.

I tried to load translations, with the code bellow, from the ngOnInit and the constructor but it doesn't change anything.

    Object.keys(V2VehiculeOutput.StatusEnum).forEach(s => {
      console.log(this.translate.instant('FILTERS.VEHICULE.STATUS.' + V2VehiculeOutput.StatusEnum[s]));
      });
    });

I read that issue https://github.com/ngx-translate/core/issues/517 but my data is not even async ... So why translate.instant is not loading my data directly ?

Am I missing something ?

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

0

This post https://www.digitalocean.com/community/tutorials/angular-ngx-translate helped me.

It seems to work normally now using this exemple.

this.translate.get(['login.username', 'login.password'])
      .subscribe(translations => {
        this.usernameLabel = translations['login.username'];
        this.passwordLabel = translations['login.password'];
});

The bug was not on each load so I will keep an eye on that but it feels good for the moment.

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