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

Help with tests for all locales #1

Open
deankarn opened this issue Aug 23, 2016 · 13 comments
Open

Help with tests for all locales #1

deankarn opened this issue Aug 23, 2016 · 13 comments
Milestone

Comments

@deankarn
Copy link
Contributor

Help with tests requested,

there are so many locales I just don't have time to add tests for all of them. The locales were generated from the CLDR Project, of which some information may not be 100% correct and the only way we're going to find that out is with tests 😄

you can use this test of the 'en' locale as a frame of reference for tests

Thank you in advance!

@joeblew99
Copy link

@joeybloggs
wow i never realised just how many locales there are.
where to start ?

I am curious how you want to approach this.

The main example does not actually do assertions, but rather prints things out from what i can see. Dont we want to do assertions ?

To know that each local is working properly, cant we steal some test harness code form for example format.js ? I know google use format.js for the Polymer localisationation web component for example.

@deankarn
Copy link
Contributor Author

hello @joeblew99 and thanks for your interest in the project!

the main example in the README is really just showcasing the functions available, but the tests are actually asserting see here

I still have to add tests for the Cardinal, Ordinal and Range rules but the formatting ones are there.

basically just replicating the tests for en for each locale is what I'm looking to do.

The formatting is where I really need help, I can barely speak english ;) let alone all these languages, and I sure don't know how things are supposed to be formatted in each locale; I'm just relying on the CLDR files, which aren't perfect.

as for the Cardinal, Ordinal and Range rules I use this page to determine what number will yield which plural rule for which locale and then add that to the tests.

I don't mind borrowing test cases from elsewhere, any help would be greatly appreciated

@joeblew99
Copy link

what about using that page (http://www.unicode.org/cldr/charts/29/supplemental/language_plural_rules.html) as a source to generate tests ?

@joeblew99
Copy link

And anywhere else that has the rules :)

@deankarn
Copy link
Contributor Author

I was initially going to do that, however like I said the CLDR files are not perfects, so if I generate tests based off of that data, of course all the tests will pass...even if the results of the test are not correct.

that is exactly why I need a human to help, if the files were 100% perfect, then I could generate but...

@joeblew99
Copy link

OK I got it.

I was also wondering if tests would be reliable if we did it that way.
But it would make it much easier for people to have somewhere to start.

Maybe gopher groups via meet up could then have a quick look and tell us
what's not correct.

Then we could update the source and rerun the generator. This way the
source also gets fixed

On Mon, 29 Aug 2016, 21:35 Dean Karn, notifications@github.com wrote:

I was initially going to do that, however like I said the CLDR files are
not perfects, so if I generate tests based off of that data, of course all
the tests will pass...even if the results of the test are not correct.

that is exactly why I need a human to help, if the files were 100%
perfect, then I could generate but...


You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
#1 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/ALcacy2uGLAv9azZc6XFOU7hVn0KAVE3ks5qkzR5gaJpZM4JrOP4
.

@deankarn
Copy link
Contributor Author

not a bad idea, I'll look into generating the initial test files

it may take me a while to get to it as this is not my only project, but hopefully it won't take me too long once I do get there.

@deankarn
Copy link
Contributor Author

OK so I generating the skeleton of the test files and now just need help from persons with locale knowledge to fill in the test cases.

@nikolay-turpitko
Copy link
Contributor

May be http://site.icu-project.org/home can be useful for this? They have C++ and Java implementation (and there are several related projects on other languages). Not sure how difficult is to generate Go binding for it, but at least, it should be possible to create Java program which would generate tests for supported locales. Not as good, as humans, but for some locales it may be better than nothing.

@deankarn
Copy link
Contributor Author

deankarn commented Nov 7, 2016

Thanks @nikolay-turpitko I will take a look!

@joeblew99
Copy link

@joeybloggs looking good. So cool to see.

Its also nice to see the tooling and sample over at:
https://github.com/bluesuncorp/wash/blob/master/helpers/trans/translations.go

I cant work out how to run this repo, as if i was someone that wanted to check a translation and make a fix to it. Maybe i am missing a trick or two (was a late one last night), but from my POV the Readme.md needs to really tell people how they can easily contribute.

I was also thinking of a basic web site running on localhost that allows a person to load up a screen in their language. Just thinking of the easiest possible way to get contributions from coders but also non coders. Non coders can just make a github issue if they can write code maybe even.

@deankarn
Copy link
Contributor Author

deankarn commented Nov 8, 2016

Thanks @joeblew99

I will try to update the readme and look at a much simpler site to load up their own languages, maybe even host one public ally and allow posting of corrections they think should be made :)

I'm just so busy with work and home, it will take me a little while to get to this.

as for running the repo it should be as easy as doing a go get and running the init.sh script and then the dev.sh in the bin directory.

if there is an issue, please let me know :) that repo also showcases most of my other libraries as well, and will, time permitting, create a framework to tie it all together and make it easier for use.

Thanks for the great ideas 😄

@joeblew99
Copy link

joeblew99 commented Nov 9, 2016

my pleasure..

I have found another good things that might be helpful.
I am using Dart for frontend, and golang for backend. Sometimes i still use gopherjs, but not much.

But i just wanted to show you this:
https://github.com/dart-lang/intl#extracting-and-using-translated-messages

Not saying we shoudl do anything about it, but its a very nice example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants