You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
However, when a regional language is used, those keys don't use the fallback language.
Describe the solution you'd like
I think it would be nice if the transpiler would use the fallback language for referenced keys if the current language doesn't include the key.
Describe alternatives you've considered
Alternatives I've considered are for example duplicating the necessary keys, but that's not ideal since maintenance would become very tedious.
Another alternative is rejecting the use of regions, but that's not really likely.
Additional context
Let me know if there's any pointers as to whether there are consequences I haven't thought of, since to me it seems like this shouldn't impact any current implementations.
I would like to make a pull request for this feature
Yes 🚀
The text was updated successfully, but these errors were encountered:
Tlepel
changed the title
Feature(transloco):
Feature(transloco): use fallback language for resolving referenced keys
Feb 5, 2024
I'm looking for exactly that. I thought setFallbackLangForMissingTranslation would do that, but it didn't. It'd be great to have a way to fallback to a specific provided language, if the key is not found in the current one. In my case, I register a lot of keys with the service in a library where the language is named en. In the consuming app, the language is named en-US. If the key is not present in en-US, I'd like transloco to get it from the fallback language, which doesn't seem to be happening today.
Is there an existing issue for this?
Which Transloco package(s) will this feature affect?
Transloco
Is your feature request related to a problem? Please describe
We reference translations quite often using this method: https://jsverse.github.io/transloco/docs/additional-functionality#reference-other-keys
However, when a regional language is used, those keys don't use the fallback language.
Describe the solution you'd like
I think it would be nice if the transpiler would use the fallback language for referenced keys if the current language doesn't include the key.
Describe alternatives you've considered
Additional context
Let me know if there's any pointers as to whether there are consequences I haven't thought of, since to me it seems like this shouldn't impact any current implementations.
I would like to make a pull request for this feature
Yes 🚀
The text was updated successfully, but these errors were encountered: