mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 20:22:45 +08:00
UX: Improve empty state copy on the activity/topics page (#17746)
This commit is contained in:
parent
4283cef2ed
commit
8f66d57b86
|
@ -1,6 +1,8 @@
|
|||
import UserAction from "discourse/models/user-action";
|
||||
import UserTopicListRoute from "discourse/routes/user-topic-list";
|
||||
import { action } from "@ember/object";
|
||||
import { htmlSafe } from "@ember/template";
|
||||
import getURL from "discourse-common/lib/get-url";
|
||||
import I18n from "I18n";
|
||||
|
||||
export default UserTopicListRoute.extend({
|
||||
|
@ -30,16 +32,22 @@ export default UserTopicListRoute.extend({
|
|||
|
||||
emptyState() {
|
||||
const user = this.modelFor("user");
|
||||
const title = this.isCurrentUser(user)
|
||||
? I18n.t("user_activity.no_topics_title")
|
||||
: I18n.t("user_activity.no_topics_title_others", {
|
||||
username: user.username,
|
||||
});
|
||||
let title, body;
|
||||
if (this.isCurrentUser(user)) {
|
||||
title = I18n.t("user_activity.no_topics_title");
|
||||
body = htmlSafe(
|
||||
I18n.t("user_activity.no_topics_body", {
|
||||
searchUrl: getURL("/search"),
|
||||
})
|
||||
);
|
||||
} else {
|
||||
title = I18n.t("user_activity.no_topics_title_others", {
|
||||
username: user.username,
|
||||
});
|
||||
body = "";
|
||||
}
|
||||
|
||||
return {
|
||||
title,
|
||||
body: "",
|
||||
};
|
||||
return { title, body };
|
||||
},
|
||||
|
||||
@action
|
||||
|
|
|
@ -4056,6 +4056,7 @@ en:
|
|||
no_likes_body: "A great way to jump in and start contributing is to start reading conversations that have already taken place, and select the %{heartIcon} on posts that you like!"
|
||||
no_likes_others: "No liked posts."
|
||||
no_topics_title: "You have not started any topics yet"
|
||||
no_topics_body: "It’s always best to <a href='%{searchUrl}'>search</a> for existing topics of conversation before starting a new one, but if you’re confident the topic you want isn’t out there already, go ahead and start a new topic of your very own. Look for the <kbd>+ New Topic</kbd> button at the top right of the topic list, category, or tag to begin creating a new topic in that area."
|
||||
no_topics_title_others: "%{username} has not started any topics yet"
|
||||
no_read_topics_title: "You haven’t read any topics yet"
|
||||
no_read_topics_body: "Once you start reading discussions, you’ll see a list here. To start reading, look for topics that interest you in <a href='%{topUrl}'>Top</a> or <a href='%{categoriesUrl}'>Categories</a> or search by keyword %{searchIcon}"
|
||||
|
|
Loading…
Reference in New Issue
Block a user