2024-05-24 10:15:53 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module I18nHelpers
|
|
|
|
def allow_missing_translations
|
2024-06-20 04:33:01 -04:00
|
|
|
original_handler = I18n.exception_handler
|
|
|
|
I18n.exception_handler = nil
|
2024-05-24 10:15:53 -04:00
|
|
|
Rails.application.config.i18n.raise_on_missing_translations = false
|
|
|
|
yield
|
|
|
|
ensure
|
2024-06-20 04:33:01 -04:00
|
|
|
I18n.exception_handler = original_handler
|
2024-05-24 10:15:53 -04:00
|
|
|
Rails.application.config.i18n.raise_on_missing_translations = true
|
|
|
|
end
|
|
|
|
end
|