mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: Remove markers from all translated languages (#14081)
Emails can include the marker in a different language, depending on site and user settings. The email receiver always looked for the marker in default language.
This commit is contained in:
@@ -549,11 +549,19 @@ module Email
|
||||
end
|
||||
|
||||
def previous_replies_regex
|
||||
@previous_replies_regex ||= /^--[- ]\n\*#{I18n.t("user_notifications.previous_discussion")}\*\n/im
|
||||
strings = I18n.available_locales.map do |locale|
|
||||
I18n.with_locale(locale) { I18n.t("user_notifications.previous_discussion") }
|
||||
end.uniq
|
||||
|
||||
@previous_replies_regex ||= /^--[- ]\n\*(?:#{strings.map { |x| Regexp.escape(x) }.join("|")})\*\n/im
|
||||
end
|
||||
|
||||
def reply_above_line_regex
|
||||
@reply_above_line_regex ||= /\n#{I18n.t("user_notifications.reply_above_line")}\n/im
|
||||
strings = I18n.available_locales.map do |locale|
|
||||
I18n.with_locale(locale) { I18n.t("user_notifications.reply_above_line") }
|
||||
end.uniq
|
||||
|
||||
@reply_above_line_regex ||= /\n(?:#{strings.map { |x| Regexp.escape(x) }.join("|")})\n/im
|
||||
end
|
||||
|
||||
def trim_discourse_markers(reply)
|
||||
|
||||
Reference in New Issue
Block a user