Skip to content

Commit

Permalink
Fix missing_translation override
Browse files Browse the repository at this point in the history
Simplify and fix override. A missing translation now returns `false`
instead of the text `translation missing`.

The super method requires the `option` parameter, so we opted to keep
the override.
  • Loading branch information
laritakr committed Dec 19, 2023
1 parent f086c09 commit 716b7ef
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,7 @@ def locale_for(type:, term:, record_class:)
end

def missing_translation(value, _options = {})
case value
when FalseClass, NilClass
true
when String
value.include?('translation missing')
else
raise "Unexpected value #{value.inspect}"
end
return true if value.try(:false?)
false
end
end

0 comments on commit 716b7ef

Please sign in to comment.