Created
November 2, 2012 15:09
-
-
Save itspriddle/4001903 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Always raise errors when I18n translations are missing. To override this | |
# behavior: | |
# | |
# I18n.t :some_key, allow_missing: false | |
I18n.exception_handler = -> exception, locale, key, options do | |
if options.delete(:allow_missing) | |
I18n::ExceptionHandler.new.call(exception, locale, key, options) | |
else | |
raise I18n::MissingTranslationData.new(locale, key, options) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment