Closed Svoig closed 6 years ago
I think you're right that this is a timing issue, which points to the TranslateService or in fact the translate pipe or directive, all of which is part of ngx-translate/core. The compiler works purely synchronously. I'm not saying I don't care, but figuring out this kind of issue can be complicated. I believe there is at least one if not several bugs related to async translation loading in ngx-translate, unfortunately. If you have the time, I encourage you to do some debugging and raise an issue on https://github.com/ngx-translate/core.
Questions you can try to answer to narrow down the problem:
You're right - switching to a synchronous loader fixes the problem. Feel free to close this issue. Thanks for your help!
I have a translation in my app that uses the
selectOrdinal
method in English, and theselect
method in Spanish. Both translations work correctly, but when I change from English to Spanish, I get the following error:It seems like the
TranslateMessageFormatCompiler
is parsing the old English translations for the Spanish locale.This only happens the first time I change languages (or when I clear the cache), which makes me think that the
TranslateHttpLoader
hasn't finished loading the new translations before the compiler starts parsing.Any thoughts?