[3.0] Say how many members are viewing, instead of always saying none - #9431
Open
albertlast wants to merge 1 commit into
Open
[3.0] Say how many members are viewing, instead of always saying none#9431albertlast wants to merge 1 commit into
albertlast wants to merge 1 commit into
Conversation
With "Show who is viewing" set to numbers only, the topic and board pages count
the members present by passing a literal zero:
Lang::getTxt('number_of_members', [0], file: 'General')
so the line always reads "0 members is viewing this topic", while the rest of the
same sentence counts them properly and picks the singular to match. On a board
with one other person on it you get the two numbers disagreeing inside one
sentence.
Counted from view_members_list rather than view_members, because that is the list
the sentence is describing: it holds the members this reader is allowed to see,
and anyone hidden gets their own mention right after it. Counting view_members
would put the hidden ones in both halves.
Verified with several people on one topic: as a moderator, who sees hidden
members in the list and gets no separate mention of them, and as an ordinary
member, who sees neither. The two numbers in the sentence now agree in both
cases, and the plural follows.
Signed-off-by: Mathias Albert <mathiaspapealbert@hotmail.com>
Signed-off-by: albertlast <mathiaspapealbert@hotmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Found while triaging the Display and MessageIndex areas of the #7933 split. Not
a theme slice — it stands on its own.
With Show who is viewing → numbers only, the topic and board pages count the
members present by passing a literal zero:
so the line always reads "0 members is viewing this topic", while
num_viewingin the very same sentence counts them properly and picks the singular to match.
Two numbers disagreeing inside one sentence:
release-3.00 members is viewing this topic.1 member is viewing this topic.0 members is viewing this topic.2 members are viewing this topic.Both templates have the same line, so both are fixed.
Why
view_members_listand notview_members. The list is what the sentencedescribes:
view_members_listholds the members this reader is allowed to see,and anyone hidden gets their own mention right after it.
view_membersholdseveryone including the hidden, so counting that would put them in both halves —
"3 members and 3 hidden" for three people, one of whom is hidden.
Testing
Several people on one topic, with
display_who_viewingset to 1:mention of them: 3 viewers →
3 members are viewing this topic.0 members and 3 hidden are viewing this topic.— no one counted twice.The plural follows correctly in each case, and the two numbers in the sentence
now agree.
Issues References (Fixes|Related|Closes)
Related to #7933