Skip to content

Avoid using pluralize on moderation pages#12589

Merged
Gargron merged 1 commit intomastodon:masterfrom
brawaru:fix/avoid-pluralize
Dec 12, 2019
Merged

Avoid using pluralize on moderation pages#12589
Gargron merged 1 commit intomastodon:masterfrom
brawaru:fix/avoid-pluralize

Conversation

@brawaru
Copy link
Copy Markdown
Contributor

@brawaru brawaru commented Dec 9, 2019

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 PR 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 pluralize-able, so have to change locale files.

Screenshot of report page, showing notes and reports counters for both reporter and reported user

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
@brawaru
Copy link
Copy Markdown
Contributor Author

brawaru commented Dec 9, 2019

By the way, i18n-tasks still tries to do this on normalization and changes to strings. Must we then finally accept these changes in another PR, so it won't bork anything and require manually reviewing each change done to localization files?

@Gargron Gargron merged commit d5b7a4b into mastodon:master Dec 12, 2019
@brawaru brawaru deleted the fix/avoid-pluralize branch April 2, 2020 22:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants