Wait for translation to load and than show translations #619
-
Is there an existing issue for this?
Which Transloco package(s) are the source of the bug?Transloco Is this a regression?No Current behaviorI have a dropdown language selector, when I switch to another language I show a snackbar. The problem is that if the language has not been loaded before, the snackbar does not show the translation, but rather the json key path to that value. Like if the key was missing. Workaround: Using a setTimeout of 100ms before showing the snackbar works. More thoughts about it:
This does not affect pipes or directive content, probably given the way they are made. Expected behaviorI would expect there should be a way to be notified once a language is fully loaded and ready to be used correctly. Note: If I am missing something that I haven't seen in the doc I very apologize in advance. Please provide a link to a minimal reproduction of the bugi-can-try-to-provide-something-later Transloco ConfigNo response Please provide the environment you discovered this bug inTransloco:
Angular:
Node:
Package Manager:
OS: BrowserNo response Additional contextNo response I would like to make a pull request for this bugYes 🚀 |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 6 replies
-
@alejandrocoding I've converted this into a discussion as this is a question relating to a specific use case, if we find that there is a generalized problem here we can address this as an issue :) |
Beta Was this translation helpful? Give feedback.
@alejandrocoding I've converted this into a discussion as this is a question relating to a specific use case, if we find that there is a generalized problem here we can address this as an issue :)
Have you tried the events$ observable to indicate when to call your snackbar?