about summary refs log tree commit diff
path: root/config
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2022-08-28 04:00:39 +0200
committerGitHub <noreply@github.com>2022-08-28 04:00:39 +0200
commit546672e292dc3218e996048464c4c52e5d00f766 (patch)
treeb3d0e0b00baf0b62cd092a144b9c43b7550f5987 /config
parentc57907737a35d05d4bb936acd662df6ce725456f (diff)
Change "Allow trends without prior review" setting to include statuses (#17977)
* Change "Allow trends without prior review" setting to include posts

* Fix i18n-tasks
Diffstat (limited to 'config')
-rw-r--r--config/i18n-tasks.yml2
-rw-r--r--config/initializers/simple_form.rb5
-rw-r--r--config/locales/en.yml4
-rw-r--r--config/locales/simple_form.en.yml1
4 files changed, 8 insertions, 4 deletions
diff --git a/config/i18n-tasks.yml b/config/i18n-tasks.yml
index 42a7afb33..1bebae5e9 100644
--- a/config/i18n-tasks.yml
+++ b/config/i18n-tasks.yml
@@ -51,7 +51,7 @@ ignore_unused:
   - 'activerecord.errors.*'
   - '{devise,pagination,doorkeeper}.*'
   - '{date,datetime,time,number}.*'
-  - 'simple_form.{yes,no,recommended}'
+  - 'simple_form.{yes,no,recommended,not_recommended}'
   - 'simple_form.{placeholders,hints,labels}.*'
   - 'simple_form.{error_notification,required}.:'
   - 'errors.messages.*'
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
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 0b721c163..9f047f523 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -808,8 +808,8 @@ en:
         title: Allow unauthenticated access to public timeline
       title: Site settings
       trendable_by_default:
-        desc_html: Affects hashtags that have not been previously disallowed
-        title: Allow hashtags to trend without prior review
+        desc_html: Specific trending content can still be explicitly disallowed
+        title: Allow trends without prior review
       trends:
         desc_html: Publicly display previously reviewed content that is currently trending
         title: Trends
diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml
index 28f78d500..ddc83e896 100644
--- a/config/locales/simple_form.en.yml
+++ b/config/locales/simple_form.en.yml
@@ -253,6 +253,7 @@ en:
         events: Enabled events
         url: Endpoint URL
     'no': 'No'
+    not_recommended: Not recommended
     recommended: Recommended
     required:
       mark: "*"