diff --git a/app/validators/poll_validator.rb b/app/validators/poll_validator.rb index d4ae4c16ab64b4a595508990af20bd64305f7b90..fd497c8d0b9eaa8cf2d27deb88b17cd76e1c0339 100644 --- a/app/validators/poll_validator.rb +++ b/app/validators/poll_validator.rb @@ -13,7 +13,7 @@ class PollValidator < ActiveModel::Validator poll.errors.add(:options, I18n.t('polls.errors.too_many_options', max: MAX_OPTIONS)) if poll.options.size > MAX_OPTIONS poll.errors.add(:options, I18n.t('polls.errors.over_character_limit', max: MAX_OPTION_CHARS)) if poll.options.any? { |option| option.mb_chars.grapheme_length > MAX_OPTION_CHARS } poll.errors.add(:options, I18n.t('polls.errors.duplicate_options')) unless poll.options.uniq.size == poll.options.size - poll.errors.add(:expires_at, I18n.t('polls.errors.duration_too_long')) if poll.expires_at.nil? || poll.expires_at - current_time >= MAX_EXPIRATION - poll.errors.add(:expires_at, I18n.t('polls.errors.duration_too_short')) if poll.expires_at.present? && poll.expires_at - current_time <= MIN_EXPIRATION + poll.errors.add(:expires_at, I18n.t('polls.errors.duration_too_long')) if poll.expires_at.nil? || poll.expires_at - current_time > MAX_EXPIRATION + poll.errors.add(:expires_at, I18n.t('polls.errors.duration_too_short')) if poll.expires_at.present? && poll.expires_at - current_time < MIN_EXPIRATION end end diff --git a/config/locales/co.yml b/config/locales/co.yml index d30fc9e967b385398301d3d96a67abc2f5478a2e..8fcb27598e5b59c1f7c7a039fddbc28fc3b9c7ef 100644 --- a/config/locales/co.yml +++ b/config/locales/co.yml @@ -741,9 +741,9 @@ co: duration_too_long: hè troppu luntanu indè u futuru duration_too_short: hè troppu prossimu expired: U scandagliu hè digià finitu - over_character_limit: ùn ponu micca esse più longhi chè %{MAX} caratteri + over_character_limit: ùn ponu micca esse più longhi chè %{max} caratteri too_few_options: deve avè più d'un'uzzione - too_many_options: ùn pò micca avè più di %{MAX} uzzione + too_many_options: ùn pò micca avè più di %{max} uzzione preferences: languages: Lingue other: Altre diff --git a/config/locales/cs.yml b/config/locales/cs.yml index e751b5266fca5021dc24d65c54f4ff9abe030a12..fe83bd57ad722dec68d456b745d2923c0037be20 100644 --- a/config/locales/cs.yml +++ b/config/locales/cs.yml @@ -752,9 +752,9 @@ cs: duration_too_long: je pÅ™ÃliÅ¡ daleko v budoucnosti duration_too_short: je pÅ™ÃliÅ¡ brzy expired: Anketa již skonÄila - over_character_limit: nesmà být každá delÅ¡Ã než %{MAX} znaků + over_character_limit: nesmà být každá delÅ¡Ã než %{max} znaků too_few_options: musà mÃt vÃce než jednu položku - too_many_options: nesmà obsahovat vÃce než %{MAX} položky + too_many_options: nesmà obsahovat vÃce než %{max} položky preferences: languages: Jazyky other: Ostatnà diff --git a/config/locales/el.yml b/config/locales/el.yml index ca821c4fc5465be711d4833c32c16ab2297f76e7..35da50af7c0f4597044ed49ee2b2d2859dfbf965 100644 --- a/config/locales/el.yml +++ b/config/locales/el.yml @@ -740,9 +740,9 @@ el: duration_too_long: είναι Ï€Î¿Î»Ï Î¼Î±ÎºÏιά στο μÎλλον duration_too_short: είναι Ï€Î¿Î»Ï ÏƒÏντομα expired: Η ψηφοφοÏία Îχει ήδη λήξει - over_character_limit: δε μποÏεί να υπεÏβαίνει τους %{MAX} χαÏακτήÏες Îκαστη + over_character_limit: δε μποÏεί να υπεÏβαίνει τους %{max} χαÏακτήÏες Îκαστη too_few_options: Ï€ÏÎπει να Îχει πεÏισσότεÏες από μια επιλογÎÏ‚ - too_many_options: δεν μποÏεί να Îχει πεÏισσότεÏες από %{MAX} επιλογÎÏ‚ + too_many_options: δεν μποÏεί να Îχει πεÏισσότεÏες από %{max} επιλογÎÏ‚ preferences: languages: Γλώσσες other: Άλλο diff --git a/config/locales/en.yml b/config/locales/en.yml index 2d23b1eb6e9f24a4e8e4cebc06afbf3929870eff..f714884f9711db652be10de61952bce23696cb74 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -741,9 +741,9 @@ en: duration_too_long: is too far into the future duration_too_short: is too soon expired: The poll has already ended - over_character_limit: cannot be longer than %{MAX} characters each + over_character_limit: cannot be longer than %{max} characters each too_few_options: must have more than one item - too_many_options: can't contain more than %{MAX} items + too_many_options: can't contain more than %{max} items preferences: languages: Languages other: Other diff --git a/config/locales/fa.yml b/config/locales/fa.yml index 4cf8f415c1f9c2b0ed01298d15414a0f1c8532c9..4214e793cbe9f00d3cf30cbcdb0a11cfad471106 100644 --- a/config/locales/fa.yml +++ b/config/locales/fa.yml @@ -741,9 +741,9 @@ fa: duration_too_long: در آیندهٔ خیلی دور است duration_too_short: در آیندهٔ خیلی نزدیک است expired: این نظرسنجی به پایان رسیده است - over_character_limit: هر کدام نمی‌تواند از %{MAX} نویسه طولانی‌تر باشد + over_character_limit: هر کدام نمی‌تواند از %{max} نویسه طولانی‌تر باشد too_few_options: Øتماً باید بیش از یک گزینه داشته باشد - too_many_options: نمی‌تواند بیشتر از %{MAX} گزینه داشته باشد + too_many_options: نمی‌تواند بیشتر از %{max} گزینه داشته باشد preferences: languages: تنظیمات زبان other: سایر تنظیمات diff --git a/config/locales/fr.yml b/config/locales/fr.yml index c84dc806399db958c75c7a47e261e6d89ef18a47..b9d813e9e57d8cc7d3578ff120ed155b5565da64 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -741,9 +741,9 @@ fr: duration_too_long: est trop loin dans le futur duration_too_short: est trop tôt expired: Ce sondage est déjà terminé - over_character_limit: ne peuvent être plus long que %{MAX} caractères chacun + over_character_limit: ne peuvent être plus long que %{max} caractères chacun too_few_options: doit avoir plus qu'une proposition - too_many_options: ne peut contenir plus que %{MAX} propositions + too_many_options: ne peut contenir plus que %{max} propositions preferences: languages: Langues other: Autre diff --git a/config/locales/gl.yml b/config/locales/gl.yml index 3c58e04f5ce596d5efea42318bc8a4f5f9efadcc..2435137f9221564e959586d298485b22acb60ec5 100644 --- a/config/locales/gl.yml +++ b/config/locales/gl.yml @@ -741,9 +741,9 @@ gl: duration_too_long: está moi lonxe no futuro duration_too_short: é demasiado cedo expired: A sondaxe rematou - over_character_limit: non poden ter máis de %{MAX} caracteres cada unha + over_character_limit: non poden ter máis de %{max} caracteres cada unha too_few_options: debe ter máis de unha opción - too_many_options: non pode haber máis de %{MAX} opcións + too_many_options: non pode haber máis de %{max} opcións preferences: languages: Idiomas other: Outro diff --git a/config/locales/ko.yml b/config/locales/ko.yml index 6fa18b12a4845879a1f4294a524dc584289d54a4..fe347a7037dd7d8f84810ac4823e2fbe731a17ac 100644 --- a/config/locales/ko.yml +++ b/config/locales/ko.yml @@ -743,9 +743,9 @@ ko: duration_too_long: 너무 먼 미래입니다 duration_too_short: 너무 ê°€ê¹ìŠµë‹ˆë‹¤ expired: 투표가 ì´ë¯¸ ë났습니다 - over_character_limit: ê°ê° %{MAX} 글ìžë¥¼ ë„˜ì„ ìˆ˜ 없습니다 + over_character_limit: ê°ê° %{max} 글ìžë¥¼ ë„˜ì„ ìˆ˜ 없습니다 too_few_options: 한가지 ì´ìƒì˜ í•ëª©ì„ í¬í•¨í•´ì•¼ 합니다 - too_many_options: í•ëª©ì€ %{MAX}개를 ë„˜ì„ ìˆ˜ 없습니다 + too_many_options: í•ëª©ì€ %{max}개를 ë„˜ì„ ìˆ˜ 없습니다 preferences: languages: 언어 other: 기타 diff --git a/config/locales/sk.yml b/config/locales/sk.yml index b29a7a934a1d2c862d63eaca84819d29e50ef77b..0800b8f8caae350fbc8f6bc2c62d8b930caef341 100644 --- a/config/locales/sk.yml +++ b/config/locales/sk.yml @@ -752,9 +752,9 @@ sk: duration_too_long: je prÃliÅ¡ Äaleko do budúcnosti duration_too_short: je prÃliÅ¡ skoro expired: Anketa už skonÄila - over_character_limit: každá nemôže byÅ¥ dlhÅ¡ia ako %{MAX} znakov + over_character_limit: každá nemôže byÅ¥ dlhÅ¡ia ako %{max} znakov too_few_options: musà maÅ¥ viac ako jednu položku - too_many_options: nemôže zahŕňaÅ¥ viac ako %{MAX} položiek + too_many_options: nemôže zahŕňaÅ¥ viac ako %{max} položiek preferences: languages: Jazyky other: Ostatné