Avoid using pluralize on moderation pages (#12589)

Pluralize function from Rails framework does not work with other
languages than English, moreover it does not even work properly with
English [1]. Not that the latest applies to this context, it's just
a sign that we best to avoid this function, especially when there are
more reliable ways.

This commit changes how reports pages generated in order to avoid usage
of pluralize function, replacing it with default translation function,
called with given counter. On top of that, we have to make strings
pluralizable, so have to change locale files.

[1]: https://medium.com/@anna7/b3927de2ca8e#6a60
This commit is contained in:
Sasha Sorokin
2019-12-13 01:50:23 +07:00
committed by Eugen Rochko
parent 1c10283217
commit d5b7a4b116
47 changed files with 11 additions and 139 deletions

View File

@ -28,7 +28,7 @@
.report-card__profile
= account_link_to target_account, '', size: 36, path: admin_account_path(target_account.id)
.report-card__profile__stats
= link_to pluralize(target_account.targeted_moderation_notes.count, t('admin.reports.account.note')), admin_account_path(target_account.id)
= link_to t('admin.reports.account.notes', count: target_account.targeted_moderation_notes.count), admin_account_path(target_account.id)
%br/
- if target_account.suspended?
%span.red= t('admin.accounts.suspended')