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
268 stars 55 forks source link

[WIP] Update to CLDR v38. Fixes #32. #33

Open bojanz opened 3 years ago

bojanz commented 3 years ago

This is going to be tough to review. Perhaps it would be easier to do the update in jumps (e.g. v32 -> v34 -> v36 -> v38).

With the newline fix in parseDateTimeFormat() I was able to get the generation process to complete.

However, multiple tests are failing. The most notable ones are for fr*, and for a reason:

func (fr *fr_CA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {

    n := math.Abs(num)
    i := int64(n)
    iMod1000000 := i % 1000000

    if i == 0 || i == 1 {
        return locales.PluralRuleOne
    } else if (e == 0 && i != 0 && iMod1000000 == 0 && v == 0) || (e < 0 || e > 5) {
        return locales.PluralRuleMany
    }

    return locales.PluralRuleOther
}

e is undefined, which means there's another bug in generate_resources.go, most likely in parseCardinalPluralRuleFunc.

bojanz commented 3 years ago

Opened #34 to try and do the update in pieces. Feel free to close it if you prefer the all-at-once-approach. In that case the ru_RU_test.go changes will have to be ported here.

EDIT: Replaced by #35, which gets us up to v36.1.

rande commented 10 months ago

For the record, this bug has been introduced by https://github.com/unicode-org/cldr/commit/4116d5414204244adfaf44e830b32271aae91e4d and the related documentation https://docs.google.com/document/d/1Wx9Drhpl9p2ZqVZMGQ7KUF4pUfPtuJupv8oQ_Gf6sEE/edit#heading=h.enp59k5s3h0h from the ticket https://unicode-org.atlassian.net/browse/CLDR-12010