From eb1a622d38e0a343d418953619e66d21823eb489 Mon Sep 17 00:00:00 2001 From: Martin Brennan Date: Mon, 27 Nov 2023 10:31:24 +1000 Subject: [PATCH] FIX: Improve group mention copy for small groups (#24558) If a group is < 5 members, the mention warning doesn't need to be so harsh. This commit changes the copy for the existing warning and adds a new one for groups that are >= 5 members. --- app/assets/javascripts/discourse/app/services/composer.js | 7 ++++++- config/locales/client.en.yml | 5 +++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/assets/javascripts/discourse/app/services/composer.js b/app/assets/javascripts/discourse/app/services/composer.js index 03bb68f6710..c5a080fcfdf 100644 --- a/app/assets/javascripts/discourse/app/services/composer.js +++ b/app/assets/javascripts/discourse/app/services/composer.js @@ -859,7 +859,12 @@ export default class ComposerService extends Service { group_link: groupLink, }); } else if (userCount > 0) { - body = I18n.t("composer.group_mentioned", { + // Louder warning for a larger group. + const translationKey = + userCount >= 5 + ? "composer.larger_group_mentioned" + : "composer.group_mentioned"; + body = I18n.t(translationKey, { group: `@${name}`, count: userCount, group_link: groupLink, diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 053b7bcf283..ae3962e9509 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -2395,8 +2395,9 @@ en: one: "Warning! You mentioned %{group}, however this group has more members than the administrator configured mention limit of %{count} user. Nobody will be notified." other: "Warning! You mentioned %{group}, however this group has more members than the administrator configured mention limit of %{count} users. Nobody will be notified." group_mentioned: - one: "By mentioning %{group}, you are about to notify %{count} person – are you sure?" - other: "By mentioning %{group}, you are about to notify %{count} people – are you sure?" + one: "Mentioning %{group} will notify %{count} person." + other: "Mentioning %{group} will notify %{count} people." + larger_group_mentioned: "Mentioning %{group} will notify %{count} people. Are you sure?" cannot_see_mention: category: "You mentioned @%{username} but they won't be notified because they do not have access to this category. You will need to add them to a group that has access to this category." private: "You mentioned @%{username} but they won't be notified because they are unable to see this personal message. You will need to invite them to this personal message."