-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use of %{count} inside the one: form of pluralization rules? #823
Comments
This issue should be re-opened. As noted here by @silva96, the changes in #993 missed some cases. I've now written a script to detect differing interpolations between the pluralization context subkeys. Running it, I see that there are still 566 similar issues across 71 locales:
Before #993 there were 1437 problems in 101 locales, so we managed to clean up just 60% of the issues. |
@movermeyer Would you be willing to carve a pull-request to fix the missing ones? 🙏🏻 |
For some translations, the
one:
form hard-codes the value1
, e.g.:rails-i18n/rails/locale/en.yml
Line 133 in 8720fa7
But for other translations of the same key, the
one:
form embeds the value of%{count}
, e.g.:rails-i18n/rails/locale/nl.yml
Line 133 in 8720fa7
We noticed this because we have a CI test that compares the set of interpolation parameters that appear in the same string, and its assertion that the set should be equal across all of our supported languages triggered a failure.
If I've understood the code correctly, the rules for the following languages actually use the
one:
form for values in the range0 < x < 2
(for example,1.5
):fr
,ff
,kab
, andlag
. So, at least for those languages, it would be better to embed%{count}
than to hard-code1
orun
. For this reason, we make a practice of using%{count}
in our own code.What is the overall policy / opinion here? If I were to prepare a PR updating
rails-i18n/rails/locale/*.yml
to use%{count}
for the variousone:
cases, would there be any interest in merging it?(This is tangentially related to #461)
The text was updated successfully, but these errors were encountered: