Add support for language preferences for trending statuses and links (#18288)

This commit is contained in:
Eugen Rochko 2022-10-08 16:45:40 +02:00 committed by GitHub
parent 678fc4d292
commit 45ebdb72ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 274 additions and 121 deletions

View file

@ -26,7 +26,7 @@ module Trends
end
def self.request_review!
return unless enabled?
return if skip_review? || !enabled?
links_requiring_review = links.request_review
tags_requiring_review = tags.request_review
@ -43,6 +43,10 @@ module Trends
Setting.trends
end
def skip_review?
Setting.trendable_by_default
end
def self.available_locales
@available_locales ||= I18n.available_locales.map { |locale| locale.to_s.split(/[_-]/).first }.uniq
end