Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

267
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda