-
-
Notifications
You must be signed in to change notification settings - Fork 196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fallback translations #52
Comments
Due to the obvious reasons, this cannot be done when using a structural directive. Ok, it's not entirely accurate as we could probably get it done by using The missing handler functionality is a "nice to have" one. We don't expect applications to be deployed with missing translation keys. The structural directive comes with this disadvantage, but with many advantages such as DRY, efficiency, the Regarding your second point, It seems unusual to me that the whole app will be in English, and one section that doesn't have a translation will be in another language. I would call it a bug. |
We are working on a powerful CLI tool that one of his options is to analyze your code and base on your translation files will inform you if you are missing certain keys. (In all languages) |
I understand all the things you say and it also makes sense to say it is a bug if one translation is missing in a language. But with the current moment being, that it is possible that a text is missing or showing some weird key to the user, seems like a but as well. The CLI tool sounds amazing and I'm looking forward to it. Do you have any timeline on when its going to be ready for use? |
@shaharkazaz is working on it. I guess something like two weeks. |
I'm closing this issue for now. We'll keep you updated when the tool is ready. Thanks. |
Hi,
So a feature request as above does make sense to me and has my support. |
@Dschuli, we support this feature. |
Sorry - I'm a new to Transloco. Just found out in the docs that I just have to set the useFallbackTranslation to use it. Was about to remove my comment ...... too late. damn. |
I'm submitting a...
Current behavior
If a translations is missing (or empty) using structural directive does not show anything at all, while using the pipe, the attribute directive or the programmatical translation returns the key of the requested translation and shows the missing translation error in the console.
Expected behavior
All possibilities of translation should behave the same way. If a translation for a key is missing, then the structural directive should also display the key as text, as well as show the error message in the console.
In my opinion it would even be more useful to use translations from fallback languages of the key if no translation is provided and only use the key if every fallback language also lacks the translation for the key. This could be optional configurable in order to not have braking changes in case some people rely on certain translations missing.
Minimal reproduction of the problem with instructions
Using the following template from the example but provide a translation where key
home
is not defined or emptyWhat is the motivation / use case for changing the behavior?
The error message in the console is very useful during development for finding missing translations. I find it very irritating for a user to see a key if a translation is missing and think it would be more useful if he would then just get a translation from a fallback language.
Environment
The text was updated successfully, but these errors were encountered: