Skip to content

A platform for community discussion. Free, open, simple.

UX: pluralize "likes/read this"

Régis Hanol13092625695a
diff --git a/app/assets/javascripts/discourse/widgets/post-menu.js.es6 b/app/assets/javascripts/discourse/widgets/post-menu.js.es6
index a9dccb91a2b..45af2c29806 100644
--- a/app/assets/javascripts/discourse/widgets/post-menu.js.es6
+++ b/app/assets/javascripts/discourse/widgets/post-menu.js.es6
@@ -578,29 +578,36 @@ export default createWidget("post-menu", {
if (state.readers.length) {
const remaining = state.totalReaders - state.readers.length;
+ const description = remaining > 0
+ ? "post.actions.people.read_capped"
+ : "post.actions.people.read";
+ const count = remaining > 0 ? remaining : state.totalReaders;
+
contents.push(
this.attach("small-user-list", {
users: state.readers,
addSelf: false,
listClassName: "who-read",
- description: "post.actions.people.read",
- count: remaining
+ description,
+ count
})
);
}
if (state.likedUsers.length) {
const remaining = state.total - state.likedUsers.length;
+ const description = remaining > 0
+ ? "post.actions.people.like_capped"
+ : "post.actions.people.like";
+ const count = remaining > 0 ? remaining : state.total;
+
contents.push(
this.attach("small-user-list", {
users: state.likedUsers,
addSelf: attrs.liked && remaining === 0,
listClassName: "who-liked",
- description:
- remaining > 0
- ? "post.actions.people.like_capped"
- : "post.actions.people.like",
- count: remaining
+ description,
+ count
})
);
}
diff --git a/app/controllers/post_action_users_controller.rb b/app/controllers/post_action_users_controller.rb
index 9cfbbc1b112..73efa06a3e4 100644
--- a/app/controllers/post_action_users_controller.rb
+++ b/app/controllers/post_action_users_controller.rb
@@ -18,13 +18,11 @@ class PostActionUsersController < ApplicationController
post_actions = post.post_actions.where(post_action_type_id: post_action_type_id)
.includes(:user)
.offset(page * page_size)
- .order('post_actions.created_at asc')
+ .order('post_actions.created_at ASC')
.limit(page_size)
if !guardian.can_see_post_actors?(post.topic, post_action_type_id)
- if !current_user
- raise Discourse::InvalidAccess
- end
+ raise Discourse::InvalidAccess unless current_user
post_actions = post_actions.where(user_id: current_user.id)
end
diff --git a/config/locales/client.en.yml b/config/locales/client.en.yml
index 26fa8ebd851..f705ae54cee 100644
--- a/config/locales/client.en.yml
+++ b/config/locales/client.en.yml
@@ -2563,11 +2563,18 @@ en:
notify_moderators: "notified moderators"
notify_user: "sent a message"
bookmark: "bookmarked this"
- like: "liked this"
- read: "read this"
+ like:
+ one: "liked this"
+ other: "liked this"
+ read:
+ one: "read this"
+ other: "read this"
like_capped:
one: "and {{count}} other liked this"
other: "and {{count}} others liked this"
+ read_capped:
+ one: "and {{count}} other read this"
+ other: "and {{count}} others read this"
by_you:
off_topic: "You flagged this as off-topic"
spam: "You flagged this as spam"
@@ -2621,7 +2628,7 @@ en:
html_part:
title: "Show the html part of the email"
button: "HTML"
-
+
bookmarks:
create: "Create bookmark"
name: "Name"