transloco icon indicating copy to clipboard operation
transloco copied to clipboard

Bug(fallbackLang): Multiple Fallback languages

Open angelaki opened this issue 2 years ago • 0 comments

Is there an existing issue for this?

  • [X] I have searched the existing issues

Which Transloco package(s) are the source of the bug?

Don't know / other

Is this a regression?

No

Current behavior

I'm not quite sure if this is a bug or working as intended since the docu says the

The fallback strategy is responsible for loading the fallback translation file, when the selected active language has failed to load.

I'd like transloco to check all the fallbackLang for the translation itself. Right now I guess it stops if a language is loaded but the translation is not found. I'd rather expect to load all the languages and check for a translation.

In my scenario I'd like to use the translation "OK" from my englisch language as a fallback. Since most of my customers use German language I set it as my default fallback (['de', 'en']). Now de gets loaded successfully, has no (own) translation for OK and so transloco stops loading further fallbacks.

Check the min repro link (Missing translation for 'alert').

Expected behavior

Load all the fallbacks and look for the translation. Don't stop with the first successful loaded language.

Please provide a link to a minimal reproduction of the bug

https://stackblitz.com/edit/transloco-example-uubfxm

Transloco Config

No response

Please provide the environment you discovered this bug in

No response

Browser

No response

Additional context

No response

I would like to make a pull request for this bug

No

angelaki avatar Jun 21 '22 13:06 angelaki