Problem with loading literals at application startup #741
Unanswered
marcoranica94
asked this question in
Q&A
Replies: 1 comment 1 reply
-
@shaharkazaz Do you maybe know something more regarding this topic? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello everyone,
I am experiencing an issue with translating the header of a table in an Angular application. I am using Angular version 17 and the latest version of Transloco.
Context:
I have an application with a table, and the setup is as follows:
Application Bootstrap:
AppComponent:
appConfig:
Problem:
The table component is created in a service, including its header and data. The creation occurs in the service's constructor. However, the table's header is not being translated despite using translocoService.translate.
I have observed that even though translocoService is instantiated, it does not contain the translation labels at the time of the table's creation. By implementing a delay (timeout) of 2 seconds before the construction of the table, the translations are applied correctly. This suggests that the translation labels are loaded after the component's creation. The same issue occurs if I move the table creation logic into the ngOnInit method instead of the constructor.
Questions:
Thank you in advance for any insights or solutions you might provide.
Beta Was this translation helpful? Give feedback.
All reactions