go-playground / locales

:earth_americas: a set of locales generated from the CLDR Project which can be used independently or within an i18n package; these were built for use with, but not exclusive to https://github.com/go-playground/universal-translator
MIT License
270 stars 57 forks source link

test: add zh_Hant_TW tests #12

Open easonlin404 opened 7 years ago

easonlin404 commented 7 years ago

Add test for zh_Hant_TW locale and also fix timezones wording as Traditional Chinese.

I don't really understand like TestPluralsRange and TestPluralsOrdinal and other PluralsXXX func mean. Please give me any advice. Thanks.

deankarn commented 7 years ago

Sorry for my late reply, life's super busy right now.

Thanks @easonlin404 but would you be able to make the timezone changes here in the code generator?

All of this code is generated by the above linked program using the cldr data here. Trying to get it generated from this new JSON data, which is a little more accurate/easier to parse, just can't find time.

As for plural rules

candinal is like when a different word is needed depending on a value modifier eg. Your payment is due in 1 day Your payment is due in 2 days

so depending on the day, in English locale anyways, it needs to be day or days depending on the value and each language has it's own rules.

Ordinal eg. He/She got 1st place He/She got 2nd place

so place modifiers st, nd, rd, th for 1st, 2nd, 3rd, 4th in English locale and again each locale has it's own rules

Range are very much like the cardinal rules, but for a range eg. 0-1 or 1-2 In English locale result of a range would be days for the word but, take danish for example: 0-1 dag 1-2 dagen

and again each locale has it's own rules; I don't know the zh_Hant_TW language well enough to write the tests for it, perhaps you can read the rules from here and come up with some examples.

easonlin404 commented 7 years ago

@joeybloggs Thank you for your explanation in detail. It’s clear to me now. I will add the timezone changes in the code generator and other TestPlurals func.

deankarn commented 7 years ago

did you regenerate based off of the data to test the changes work?

easonlin404 commented 7 years ago

I have tested using CLDR v30.0.3. And timezones just the same as ori version. So I will undo my timezones change.

deankarn commented 7 years ago

@easonlin404 so I'm a little confused, did adding your timezone change and regenerating correct the timezone issues? and I don't see any changes to the actual locale?

I do want to have the correct timezone parsing, regardless of what's in the CLDR data.

easonlin404 commented 7 years ago

Sorry for my late reply, I had undo my change. And how do I correct timezone parsing? I don't exactly know how to start for it here

deankarn commented 7 years ago

Sorry for late reply, super busy

The link in your previous message should be the correct location to make the changes, just check that it matches the locale, or Base local, and make changes as necessary as you did before and then regenerate using the CLDR data, your changes should override and you'll see the changes reflected in the locale.

If not let me know :)