-
Notifications
You must be signed in to change notification settings - Fork 7
Description
With the NoUnnecessaryPlurals validation rule in place, translators sometimes manually fix messages in a way that leads to no more errors, but also a non-functional string. For example:
{intervalCount, plural, one {#ヶ月} other {#ヶ月}}
This string has an unnecessary plural and should have it removed. Attempting to manually fix this string is likely to end up with:
#ヶ月
But this is now incorrect and won't render as expected, since # is not valid outside of a plural arm. Instead, the correct solution here is to change the variable to a plain number:
{intervalCount, number}ヶ月
This is what the diagnostic's autofix will suggest and implement, but we can't currently prevent the incorrect value from being applied manually instead.
What we can do, though, is add a validation rule to detect any # outside of a plural arm and warn about its existence. It's fairly rare for # to be used in plain message text, but if issues do come up, the workaround would be to use escape sequences like \# to prevent it from being treated like a usual placeholder, and the rule can be configured as warning-only to prevent blockages.