-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Fix default: nil with fallbacks #387
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great to me. Thanks for fixing this bug and cleaning up the code.
This will go out in the 0.9.0 release, probably next week or week after. |
This change introduce a regression. Here is the regression test: diff --git a/test/backend/fallbacks_test.rb b/test/backend/fallbacks_test.rb
index 23e4713..a220c03 100644
--- a/test/backend/fallbacks_test.rb
+++ b/test/backend/fallbacks_test.rb
@@ -64,6 +64,10 @@ class I18nBackendFallbacksTranslateTest < I18n::TestCase
assert_nil I18n.t(:missing_bar, :locale => :'de-DE', :default => nil)
end
+ test "returns the translation missing message if the default is also missing" do
+ assert_equal 'translation missing: de-DE.missing_bar', I18n.t(:missing_bar, :locale => :'de-DE', :default => [:missing_baz])
+ end
+
test "returns the :'de-DE' default :baz translation for a missing :'de-DE' when defaults contains Symbol" do
assert_equal 'Baz in :de-DE', I18n.t(:missing_foo, :locale => :'de-DE', :default => [:baz, "Default Bar"])
end |
Failure message:
|
#389 should fix that regression. |
When either the key and the all the defaults have missing translation we should be showing the original key in the translation missing message. Before this commit we were showing a translation missing error in the "no key" key. This commit fixes a regression introduced in ruby-i18n#387.
Can I force it to return |
Try using |
Awesome! Thanks @daniel-rikowski. |
Fixes #386