From 34a631c6226a0ea28c466f7973ccd89243b875aa Mon Sep 17 00:00:00 2001 From: GunChleoc Date: Fri, 1 Sep 2023 16:38:11 +0100 Subject: [PATCH] Pluralize scheduled status limits (untested) --- app/models/scheduled_status.rb | 4 ++-- config/locales/en.yml | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/app/models/scheduled_status.rb b/app/models/scheduled_status.rb index 1f4f04268d4..b241790d769 100644 --- a/app/models/scheduled_status.rb +++ b/app/models/scheduled_status.rb @@ -31,10 +31,10 @@ class ScheduledStatus < ApplicationRecord end def validate_total_limit - errors.add(:base, I18n.t('scheduled_statuses.over_total_limit', limit: TOTAL_LIMIT)) if account.scheduled_statuses.count >= TOTAL_LIMIT + errors.add(:base, I18n.t('scheduled_statuses.over_total_limit', count: TOTAL_LIMIT)) if account.scheduled_statuses.count >= TOTAL_LIMIT end def validate_daily_limit - errors.add(:base, I18n.t('scheduled_statuses.over_daily_limit', limit: DAILY_LIMIT)) if account.scheduled_statuses.where('scheduled_at::date = ?::date', scheduled_at).count >= DAILY_LIMIT + errors.add(:base, I18n.t('scheduled_statuses.over_daily_limit', count: DAILY_LIMIT)) if account.scheduled_statuses.where('scheduled_at::date = ?::date', scheduled_at).count >= DAILY_LIMIT end end diff --git a/config/locales/en.yml b/config/locales/en.yml index 2ab8f015d36..18d831b73ec 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -1754,9 +1754,13 @@ en: account: Public posts from @%{acct} tag: 'Public posts tagged #%{hashtag}' scheduled_statuses: - over_daily_limit: You have exceeded the limit of %{limit} scheduled posts for today - over_total_limit: You have exceeded the limit of %{limit} scheduled posts - too_soon: date must be in the future + over_daily_limit: + one: You have exceeded the limit of %{limit} scheduled post for today + other: You have exceeded the limit of %{limit} scheduled posts for today + over_total_limit: + one: You have exceeded the limit of %{limit} scheduled post + other: You have exceeded the limit of %{limit} scheduled posts + too_soon: The scheduled date must be in the future self_destruct: lead_html: Unfortunately, %{domain} is permanently closing down. If you had an account there, you will not be able to continue using it, but you can still request a backup of your data. title: This server is closing down