From dd4c452c66fe5b6d4c9f12ae7f9063e76ada82ec Mon Sep 17 00:00:00 2001 From: awesomerobot Date: Fri, 10 Mar 2023 16:42:57 -0500 Subject: [PATCH] UX: clearer assign messages on first post --- .../discourse-assign/initializers/extend-for-assigns.js | 9 +++++++-- config/locales/client.en.yml | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js index c7ee09d..01cec2e 100644 --- a/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js +++ b/assets/javascripts/discourse-assign/initializers/extend-for-assigns.js @@ -704,6 +704,7 @@ function initialize(api) { if (assignedToUser) { assigneeElements.push( h("span.assignee", [ + h("span", `${I18n.t("discourse_assign.topic_to")} `), h( "a", { @@ -720,6 +721,7 @@ function initialize(api) { if (assignedToGroup) { assigneeElements.push( h("span.assignee", [ + h("span", `${I18n.t("discourse_assign.topic_to")} `), h( "a", { @@ -747,7 +749,10 @@ function initialize(api) { href: `${topic.url}/${postNumber}`, }, }, - `#${postNumber} ${assignee.username || assignee.name}` + I18n.t("discourse_assign.assign_post_to", { + post_number: postNumber, + username: assignee.username || assignee.name, + }) ), ]) ); @@ -756,7 +761,7 @@ function initialize(api) { if (!isEmpty(assigneeElements)) { return h("p.assigned-to", [ assignedToUser ? iconNode("user-plus") : iconNode("group-plus"), - h("span.assign-text", I18n.t("discourse_assign.assigned_to")), + h("span.assign-text", I18n.t("discourse_assign.assigned")), assigneeElements, ]); } diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml index 829c94f..585baeb 100644 --- a/config/locales/client.en.yml +++ b/config/locales/client.en.yml @@ -27,6 +27,8 @@ en: assigned: "Assigned" group_everyone: "Everyone" assigned_to: "Assigned to" + topic_to: "topic to" + assign_post_to: "#%{post_number} to %{username}" assigned_to_w_ellipsis: "Assigned to..." assign_notification: "

%{username} %{description}

" assign_group_notification: "

%{username} %{description}

"