From 7319306d08ff86d99df17cec015f74e2c62783ca Mon Sep 17 00:00:00 2001 From: Chris Oliver Date: Thu, 12 Oct 2023 07:07:33 -0500 Subject: [PATCH] Simplify html translations by just calling module directly --- lib/noticed/translation.rb | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/noticed/translation.rb b/lib/noticed/translation.rb index 44571def..0810157b 100644 --- a/lib/noticed/translation.rb +++ b/lib/noticed/translation.rb @@ -2,8 +2,6 @@ module Noticed module Translation extend ActiveSupport::Concern - include ActiveSupport::HtmlSafeTranslation if defined?(ActiveSupport::HtmlSafeTranslation) - # Returns the +i18n_scope+ for the class. Overwrite if you want custom lookup. def i18n_scope :notifications @@ -14,8 +12,8 @@ def class_scope end def translate(key, **options) - if defined?(super) - super scope_translation_key(key), **options + if defined?(::ActiveSupport::HtmlSafeTranslation) + ActiveSupport::HtmlSafeTranslation.translate scope_translation_key(key), **options else I18n.translate scope_translation_key(key), **options end