mirror of
https://github.com/discourse/discourse.git
synced 2025-05-22 07:53:49 +08:00
FEATURE: Site setting for typographic quotation marks
Adds locale defaults for German and French
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
class MarkdownTypographerQuotationMarksValidator
|
||||
QUOTE_COUNT = 4
|
||||
|
||||
def initialize(opts = {})
|
||||
@opts = opts
|
||||
end
|
||||
|
||||
def valid_value?(value)
|
||||
value.present? && value.split("|").size == QUOTE_COUNT
|
||||
end
|
||||
|
||||
def error_message
|
||||
I18n.t("site_settings.errors.list_value_count", count: QUOTE_COUNT)
|
||||
end
|
||||
end
|
Reference in New Issue
Block a user