Displaying 1 result from an estimated 1 matches for "custom_handl".
Did you mean:
custom_handler
2010 Oct 01
0
Questions about translation method
Hi,
In my project I need to customize the output of translate/t method
when there is no translation found. I''ve follow the rails guide about
I18n API section 6.2 and made a custom exception handler in an
initializer file.
module I18n
def custom_handler(exception, key, locale, options)
case exception
when I18n::MissingTranslationData
I18n.normalize_keys(locale, key, options[:scope]).join(''.'')
else
raise exception
end
end
end
I18n.exception_handler = :custom_handler
But this has no effect....