Feature request for eslint-plugin-formatjs: lint rule to require placeholders for numbers in all branches of ICU plurals
Today, a lot of engineers I work with will write ICU strings like {numThings, plural, one{1 thing}, other{# things}}. The lack of a placeholder in the one case 1 thing causes problems downstream for our localization team, as the translation platform only lets the translators use the placeholders which are present in the source string. Slavic languages like Russian and Polish, unlike English, reuse the "one" form of the plural for multiple numbers - in Russian, the one form is also used for 21, 31, 41 - etc - so when they are translating the one form, they need the placeholder in the original string. So the original string should be {numThings, plural, one{# thing}, other{# things}}; other variants like {numThings, plural, one{{numThings} thing}, other{{numThings} things}} would also be acceptable.
A lint rule should be able to catch this, and ideally recommend an autofix.
yeah that shouldn't be too bad
@longlho I've already have this eslint rule in-house, will push a fix upstream
@longlho I've pushed the rule as a pull request. Can you please review that whenever possible? 🙏
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I believe there is in progress work for this. The request still remains valid either way
On Sun, Sep 29, 2024, 7:03 PM github-actions[bot] @.***> wrote:
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
— Reply to this email directly, view it on GitHub https://github.com/formatjs/formatjs/issues/4478#issuecomment-2381863248, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAIGO53JIGWDKXGYT2ZTPJDZZCWPLAVCNFSM6AAAAABLK5TLIWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDGOBRHA3DGMRUHA . You are receiving this because you authored the thread.Message ID: @.***>
solved by 0fa83d47efc04e65acacb6cad8fc585b8882a77f (implemented in #4500)