FIX: "Customize Text" showed compiled MessageFormat string for overridden _MF translations

This commit is contained in:
Gerhard Schlager
2021-12-16 16:54:45 +01:00
committed by Gerhard Schlager
parent e19a7a7c8d
commit 4cd5158974
4 changed files with 54 additions and 14 deletions

View File

@ -157,11 +157,6 @@ class Admin::SiteTextsController < Admin::AdminController
end
def record_for(key:, value: nil, locale:)
if key.ends_with?("_MF")
override = TranslationOverride.where(translation_key: key, locale: locale).pluck(:value)
value = override&.first
end
value ||= I18n.with_locale(locale) { I18n.t(key) }
{ id: key, value: value, locale: locale }
end