Skip to content
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

Latvian plurals #231

Closed
timwhitlock opened this issue Mar 27, 2014 · 4 comments
Closed

Latvian plurals #231

timwhitlock opened this issue Mar 27, 2014 · 4 comments

Comments

@timwhitlock
Copy link

I believe your plural numbers array for Latvian is wrong.
It should be [1,2,0] not [0,1,2]

@jamuhl
Copy link
Member

jamuhl commented Mar 28, 2014

thanks for reporting...you believe or you confirm? -> i got no idea what is right...i just copied that from another source ;)

@timwhitlock
Copy link
Author

I tried to find the exact source of the numbers array. I'm familiar with the equations, but I followed the link in i18next.plurals.js and could not find the raw data for those numbers.

Anyway, my understanding is that those numbers are only examples of the value n, so plugging in each one to the equation should yield the index of the array. I unit-tested all the equations with this expectation and "lv" was the only failure.

Prove [ 1, 2, 0 ] in a console as follows:

> var n, numbers = [ 1, 2, 0 ];
> n = numbers[0], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
0 // yup
> n = numbers[1], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
1 // yup
> n = numbers[2], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
2 // yup

and disproving [ 0, 1, 2 ]

> var numbers = [ 0, 1, 2 ]
> n = numbers[0], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
2 // nope
> n = numbers[1], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
0 // nope
> n = numbers[2], n%10==1 && n%100!=11 ? 0 : n !== 0 ? 1 : 2;
1 // nope

@jamuhl
Copy link
Member

jamuhl commented Mar 28, 2014

thanks for clarifying - will change this for upcoming release...hope that will be next week.

@jamuhl
Copy link
Member

jamuhl commented Apr 19, 2014

thanks again...changed in current code...will deploy the corrected version today in 1.7.3

@jamuhl jamuhl closed this as completed Apr 19, 2014
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

No branches or pull requests

2 participants