From 546672e292dc3218e996048464c4c52e5d00f766 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sun, 28 Aug 2022 04:00:39 +0200 Subject: Change "Allow trends without prior review" setting to include statuses (#17977) * Change "Allow trends without prior review" setting to include posts * Fix i18n-tasks --- config/initializers/simple_form.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'config/initializers') diff --git a/config/initializers/simple_form.rb b/config/initializers/simple_form.rb index 3a2097d2f..92cffc5a2 100644 --- a/config/initializers/simple_form.rb +++ b/config/initializers/simple_form.rb @@ -11,7 +11,10 @@ end module RecommendedComponent def recommended(_wrapper_options = nil) return unless options[:recommended] - options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t('simple_form.recommended'), class: 'recommended')]) } + + key = options[:recommended].is_a?(Symbol) ? options[:recommended] : :recommended + options[:label_text] = ->(raw_label_text, _required_label_text, _label_present) { safe_join([raw_label_text, ' ', content_tag(:span, I18n.t(key, scope: 'simple_form'), class: key)]) } + nil end end -- cgit