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
In other words: If you have a default of nil and the first fallback locale doesn't return a value, the default is applied immediately. The loop is exited and no further fallbacks are tried.
The solution is to delay the default check until all fallbacks are tried.
I've prepared a PR with a failing test case for this problem. See #387
The text was updated successfully, but these errors were encountered:
I've noticed that using
default: nil
with fallbacks leads to breaking the fallback chain.Given these translations:
I18n.t('bar', locale: :'de-DE', default: '')
returns'Bar from de'
馃憤I18n.t('bar', locale: :'de-DE', default: nil)
returnsnil
馃憥This is caused by the return statement in this code from fallbacks.rb: (simplified for readability)
In other words: If you have a default of
nil
and the first fallback locale doesn't return a value, the default is applied immediately. The loop is exited and no further fallbacks are tried.The solution is to delay the default check until all fallbacks are tried.
I've prepared a PR with a failing test case for this problem. See #387
The text was updated successfully, but these errors were encountered: