FEATURE: Site setting for typographic quotation marks

Adds locale defaults for German and French
This commit is contained in:
Gerhard Schlager
2019-07-11 23:15:35 +02:00
parent 1d38040579
commit 9a11a8b33b
5 changed files with 38 additions and 1 deletions

View File

@ -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