Raise when there's a I18n translation missing

Posted . Visible to the public.

The translation method translate and its alias t have bang brothers: translate! and t!. They will raise I18n::MissingTranslationData on a missing translation instead of printing a string like translation missing: de.custom.failure.

To turn on raising globally, you need to replace the default exception handler. The attached initializer makes I18n just raise any exception (in a development or test environment).

Dominik Schöler
Last edit
License
Source code in this card is licensed under the MIT License.
Posted by Dominik Schöler to makandra dev (2013-08-29 08:59)