From 1af33fdb713096e9d1b7aad8af9f1748995c3f65 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Mon, 31 Jul 2023 11:41:30 +0200 Subject: [PATCH] REFACTOR: Use pluralized string for `js.badges.awarded` --- .../admin/addon/templates/admin-badges/show.hbs | 9 +++++++-- .../javascripts/discourse/app/components/badge-card.hbs | 9 +++++++-- config/locales/client.en.yml | 7 +++---- 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs b/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs index 086560451bb..c909f9b9923 100644 --- a/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs +++ b/app/assets/javascripts/admin/addon/templates/admin-badges/show.hbs @@ -287,8 +287,13 @@
- {{number this.grant_count}} - {{i18n "badges.awarded"}} + {{html-safe + (i18n + "badges.awarded" + count=this.displayCount + number=(number this.displayCount) + ) + }}
diff --git a/app/assets/javascripts/discourse/app/components/badge-card.hbs b/app/assets/javascripts/discourse/app/components/badge-card.hbs index eca0ebef940..ba023121086 100644 --- a/app/assets/javascripts/discourse/app/components/badge-card.hbs +++ b/app/assets/javascripts/discourse/app/components/badge-card.hbs @@ -47,8 +47,13 @@ @model={{this.badge}} class="badge-granted" > - {{number this.displayCount}} - {{i18n "badges.awarded"}} + {{html-safe + (i18n + "badges.awarded" + count=this.displayCount + number=(number this.displayCount) + ) + }} {{/if}} diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 377ac3ff07c..39438309736 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -4168,10 +4168,9 @@ en: more_badges: one: "+%{count} More" other: "+%{count} More" - granted: - one: "%{count} granted" - other: "%{count} granted" - awarded: awarded + awarded: + one: "%{number} awarded" + other: "%{number} awarded" select_badge_for_title: Select a badge to use as your title none: "(none)" successfully_granted: "Successfully granted %{badge} to %{username}"