UX: Improve empty state copy on the activity/replies page (#17784)

This commit is contained in:
Andrei Prigorshnev 2022-08-18 18:00:15 +04:00 committed by GitHub
parent d7c1ff3116
commit e49167b311
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 6 deletions

View File

@ -2,6 +2,8 @@ import UserAction from "discourse/models/user-action";
import UserActivityStreamRoute from "discourse/routes/user-activity-stream";
import I18n from "I18n";
import { action } from "@ember/object";
import { htmlSafe } from "@ember/template";
import getURL from "discourse-common/lib/get-url";
export default UserActivityStreamRoute.extend({
userActionType: UserAction.TYPES["posts"],
@ -9,12 +11,21 @@ export default UserActivityStreamRoute.extend({
emptyState() {
const user = this.modelFor("user");
const title = this.isCurrentUser(user)
? I18n.t("user_activity.no_replies_title")
: I18n.t("user_activity.no_replies_title_others", {
username: user.username,
});
const body = "";
let title, body;
if (this.isCurrentUser(user)) {
title = I18n.t("user_activity.no_replies_title");
body = htmlSafe(
I18n.t("user_activity.no_replies_body", {
searchUrl: getURL("/search"),
})
);
} else {
title = I18n.t("user_activity.no_replies_title_others", {
username: user.username,
});
body = "";
}
return { title, body };
},

View File

@ -4062,6 +4062,7 @@ en:
no_activity_body: "Welcome to our community! You are brand new here and have not yet contributed to discussions. As a first step, visit <a href='%{topUrl}'>Top</a> or <a href='%{categoriesUrl}'>Categories</a> and just start reading! Select %{heartIcon} on posts that you like or want to learn more about. As you participate, your activity will be listed here."
no_replies_title: "You have not replied to any topics yet"
no_replies_title_others: "%{username} has not replied to any topics yet"
no_replies_body: "When you <a href='%{searchUrl}'>discover</a> an interesting conversation that you wish to contribute to, press the <kbd>Reply</kbd> button directly under any post to begin repying to that specific post. Or, if youd prefer to reply to the general topic rather than any individual post or person, look for the <kbd>Reply</kbd> button at the very bottom of the topic, or under the topic timeline."
no_drafts_title: "You havent started any drafts"
no_drafts_body: "Not quite ready to post? Well automatically save a new draft and list it here whenever you start composing a topic, reply, or personal message. Select the cancel button to discard or save your draft to continue later."
no_likes_title: "You havent liked any topics yet"