Skip to content

Commit

Permalink
fix[Op#40437]: switch to i18n pluralization
Browse files Browse the repository at this point in the history
  • Loading branch information
akabiru and Kharonus committed Oct 25, 2024
1 parent 54c0ff6 commit 99f264f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -75,10 +75,10 @@ def number_of_user_reactions_text(users, max_displayed_users_count: 5)
if user_count <= max_displayed_users_count
"#{displayed_users[0..-2].join(', ')} #{I18n.t('reactions.and_user', user: displayed_users.last)}"
elsif user_count == max_displayed_users_count + 1
"#{displayed_users.join(', ')} #{I18n.t('reactions.and_n_others_singular', n: 1)}"
"#{displayed_users.join(', ')} #{I18n.t('reactions.and_others', count: 1)}"
else
"#{displayed_users.join(', ')} #{I18n.t('reactions.and_n_others_plural',
n: user_count - max_displayed_users_count)}"
"#{displayed_users.join(', ')} #{I18n.t('reactions.and_others',
count: user_count - max_displayed_users_count)}"
end
end

Expand Down
5 changes: 3 additions & 2 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -551,8 +551,9 @@ en:
add_reaction: "Add reaction"
react_with: "React with %{reaction}"
and_user: "and %{user}"
and_n_others_singular: "and %{n} other"
and_n_others_plural: "and %{n} others"
and_others:
one: and 1 other
other: and %{count} others
reaction_by: "%{reaction} by"

reportings:
Expand Down

0 comments on commit 99f264f

Please sign in to comment.