-
Notifications
You must be signed in to change notification settings - Fork 8.2k
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
DEV: Catch missing translations during test runs #26258
Conversation
abceb02
to
78832c2
Compare
@@ -122,7 +122,8 @@ def translate_no_override(key, options) | |||
dup_options = nil | |||
if options | |||
dup_options = options.dup | |||
should_raise = dup_options.delete(:raise) | |||
should_raise = | |||
dup_options.delete(:raise) || Rails.application.config.i18n.raise_on_missing_translations |
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.
A little bit of coupling here, but that's because our freedom patch isn't made to work with the built-in exception handler, which is how the Railtie makes this connection normally.
d533949
to
bc82ccd
Compare
@@ -282,7 +282,7 @@ def stub_empty_referred_topics_data | |||
it "returns localized titles" do | |||
stub_empty_referred_topics_data | |||
expect(top_referred_topics[:title]).to be_present | |||
expect(top_referred_topics[:xaxis]).to be_present |
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.
The reason this was "present" is because it was a string: "Missing translation for ...", which misses the intent of the test.
b83afa1
to
800afe2
Compare
f72614d
to
e9b3a52
Compare
e9b3a52
to
85c679e
Compare
85c679e
to
0cf7bf5
Compare
What is this change?
This configuration makes it so that a missing translation will raise an error during test execution. Better discover there than after deploy.