Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

264
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!