-
Notifications
You must be signed in to change notification settings - Fork 62
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
Weird translation of zero count in plural messages (one ::: plural ::: none) #53
Comments
Hi @infinite-dao, Thank you for reporting this. Actually the problem is due to the way that multiple languages handle translations and the fact we introduced this at a later stage in the project and forgot to clean up the testing. In the file src/vuex-i18n-plurals.js the available plural forms for all languages are defined. By default – which includes English – it will return the first form for 1 and the second form for all others. I.e. returning "We have 0 blocks" instead of "We have no blocks". Which basically both would be correct translations. To make the use case work again, we would probably need to check, whether the default language specification is used and then also check if there is a third translation available which would then be used to define the zero translation string. |
+1 |
Using v1.8.0 and doing testing in the test folder: if I enter at “Number of blocks” 0 then the message comes out “We have 0 blocks” instead of “We have no blocks”. This is weird. Somehow function plurals.getTranslationIndex returns 1 which extracts from the message array “We have 0 blocks”.
Am I wrong or could this be fixed? Thank you
The text was updated successfully, but these errors were encountered: