Raise translation errors in specs
This commit is contained in:
parent
7912c8af3b
commit
c95ce3bd0c
1 changed files with 15 additions and 0 deletions
|
|
@ -5,3 +5,18 @@ module I18n
|
||||||
end
|
end
|
||||||
|
|
||||||
I18n.exception_handler = :just_raise_that_exception
|
I18n.exception_handler = :just_raise_that_exception
|
||||||
|
module ActionView
|
||||||
|
module Helpers
|
||||||
|
module TranslationHelper
|
||||||
|
def translate(key, options = {})
|
||||||
|
translation = I18n.translate(scope_key_by_partial(key), options.merge!(:raise => true))
|
||||||
|
if html_safe_translation_key?(key) && translation.respond_to?(:html_safe)
|
||||||
|
translation.html_safe
|
||||||
|
else
|
||||||
|
translation
|
||||||
|
end
|
||||||
|
end
|
||||||
|
alias :t :translate
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue