Skip to content

Commit

Permalink
Merge pull request #16 from nicola-spb/master
Browse files Browse the repository at this point in the history
Updated CLDR to 31.0.1; Added test for russian; Added methods Decimal…
  • Loading branch information
deankarn authored Oct 14, 2017
2 parents 1e5f116 + 720cad5 commit e4cbcb5
Show file tree
Hide file tree
Showing 723 changed files with 14,965 additions and 4,058 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ an i18n package; these were built for use with, but not exclusive to, [Universal

Features
--------
- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v30.0.3
- [x] Rules generated from the latest [CLDR](http://cldr.unicode.org/index/downloads) data, v31.0.1
- [x] Contains Cardinal, Ordinal and Range Plural Rules
- [x] Contains Month, Weekday and Timezone translations built in
- [x] Contains Date & Time formatting functions
Expand Down
25 changes: 20 additions & 5 deletions af/af.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.C.", "n.C."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
timezones: map[string]string{"CST": "Sentrale standaardtyd", "WIT": "Oos-Indonesië-tyd", "WEZ": "Wes-Europese standaardtyd", "EDT": "Oostelike dagligtyd", "HECU": "Kuba-dagligtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "JDT": "Japan-dagligtyd", "MEZ": "Sentraal-Europese standaardtyd", "MDT": "MDT", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "BOT": "Bolivia-tyd", "CHADT": "Chatham-dagligtyd", "NZST": "Nieu-Seeland-standaardtyd", "VET": "Venezuela-tyd", "OEZ": "Oos-Europese standaardtyd", "BT": "Bhoetan-tyd", "HNT": "Newfoundland-standaardtyd", "AEST": "Australiese Oostelike standaardtyd", "SRT": "Suriname-tyd", "EAT": "Oos-Afrika-tyd", "AWDT": "Australiese Westelike dagligtyd", "TMT": "Turkmenistan-standaardtyd", "ACDT": "Australiese sentrale dagligtyd", "SGT": "Singapoer-standaardtyd", "CAT": "Sentraal-Afrika-tyd", "WARST": "Wes-Argentinië-somertyd", "HEOG": "Wes-Groenland-somertyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "COST": "Colombië-somertyd", "AKDT": "Alaska-dagligtyd", "PST": "Pasifiese standaardtyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "HNCU": "Kuba-standaardtyd", "CLST": "Chili-somertyd", "HAT": "Newfoundland-dagligtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "UYT": "Uruguay-standaardtyd", "MYT": "Maleisië-tyd", "WART": "Wes-Argentinië-standaardtyd", "AST": "Atlantiese standaardtyd", "WAT": "Wes-Afrika-standaardtyd", "EST": "Oostelike standaardtyd", "WITA": "Sentraal Indonesië-tyd", "AWST": "Australiese Westelike standaardtyd", "WESZ": "Wes-Europese somertyd", "HNOG": "Wes-Groenland-standaardtyd", "HKT": "Hongkong-standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "CDT": "Sentrale dagligtyd", "MST": "MST", "ART": "Argentinië-standaardtyd", "OESZ": "Oos-Europese somertyd", "ARST": "Argentinië-somertyd", "WAST": "Wes-Afrika-somertyd", "HEEG": "Oos-Groenland-somertyd", "∅∅∅": "∅∅∅", "HAST": "Hawaii-Aleusiër-standaardtyd", "JST": "Japan-standaardtyd", "MESZ": "Sentraal-Europese somertyd", "IST": "Indië-standaardtyd", "ECT": "Ecuador-tyd", "PDT": "Pasifiese dagligtyd", "GFT": "Frans-Guiana-tyd", "AKST": "Alaska-standaardtyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "LHDT": "Lord Howe-dagligtyd", "NZDT": "Nieu-Seeland-dagligtyd", "HKST": "Hongkong-somertyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "COT": "Colombië-standaardtyd", "HNEG": "Oos-Groenland-standaardtyd", "ChST": "Chamorro-standaardtyd", "LHST": "Lord Howe-standaardtyd", "GYT": "Guyana-tyd", "CHAST": "Chatham-standaardtyd", "GMT": "Greenwich-mediaantyd", "ACST": "Australiese sentraal-standaardtyd", "WIB": "Wes-Indonesië-tyd", "CLT": "Chili-standaardtyd", "AEDT": "Australiese Oostelike dagligtyd", "UYST": "Uruguay-somertyd", "ADT": "Atlantiese dagligtyd", "TMST": "Turkmenistan-somertyd"},
timezones: map[string]string{"CST": "Sentrale standaardtyd", "MST": "MST", "MYT": "Maleisië-tyd", "CAT": "Sentraal-Afrika-tyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "BOT": "Bolivia-tyd", "MEZ": "Sentraal-Europese standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "LHDT": "Lord Howe-dagligtyd", "VET": "Venezuela-tyd", "SAST": "Suid-Afrika-standaardtyd", "HEEG": "Oos-Groenland-somertyd", "CLST": "Chili-somertyd", "EDT": "Oostelike dagligtyd", "GYT": "Guyana-tyd", "AKST": "Alaska-standaardtyd", "ACST": "Australiese sentraal-standaardtyd", "PST": "Pasifiese standaardtyd", "HECU": "Kuba-dagligtyd", "WART": "Wes-Argentinië-standaardtyd", "ARST": "Argentinië-somertyd", "HNT": "Newfoundland-standaardtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "AST": "Atlantiese standaardtyd", "HNOG": "Wes-Groenland-standaardtyd", "WAST": "Wes-Afrika-somertyd", "UYST": "Uruguay-somertyd", "TMST": "Turkmenistan-somertyd", "WITA": "Sentraal Indonesië-tyd", "HKT": "Hongkong-standaardtyd", "AWST": "Australiese Westelike standaardtyd", "WARST": "Wes-Argentinië-somertyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "AKDT": "Alaska-dagligtyd", "SRT": "Suriname-tyd", "OEZ": "Oos-Europese standaardtyd", "HEOG": "Wes-Groenland-somertyd", "HNEG": "Oos-Groenland-standaardtyd", "COT": "Colombië-standaardtyd", "GFT": "Frans-Guiana-tyd", "WEZ": "Wes-Europese standaardtyd", "WIB": "Wes-Indonesië-tyd", "MDT": "MDT", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "UYT": "Uruguay-standaardtyd", "JST": "Japan-standaardtyd", "ADT": "Atlantiese dagligtyd", "HAT": "Newfoundland-dagligtyd", "EST": "Oostelike standaardtyd", "BT": "Bhoetan-tyd", "CDT": "Sentrale dagligtyd", "TMT": "Turkmenistan-standaardtyd", "LHST": "Lord Howe-standaardtyd", "COST": "Colombië-somertyd", "ChST": "Chamorro-standaardtyd", "OESZ": "Oos-Europese somertyd", "HKST": "Hongkong-somertyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "IST": "Indië-standaardtyd", "∅∅∅": "Peru-somertyd", "CHAST": "Chatham-standaardtyd", "MESZ": "Sentraal-Europese somertyd", "NZDT": "Nieu-Seeland-dagligtyd", "JDT": "Japan-dagligtyd", "GMT": "Greenwich-mediaantyd", "PDT": "Pasifiese dagligtyd", "HNCU": "Kuba-standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "AEST": "Australiese Oostelike standaardtyd", "AEDT": "Australiese Oostelike dagligtyd", "ACDT": "Australiese sentrale dagligtyd", "WESZ": "Wes-Europese somertyd", "CHADT": "Chatham-dagligtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "ART": "Argentinië-standaardtyd", "EAT": "Oos-Afrika-tyd", "ECT": "Ecuador-tyd", "SGT": "Singapoer-standaardtyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "AWDT": "Australiese Westelike dagligtyd", "WIT": "Oos-Indonesië-tyd", "CLT": "Chili-standaardtyd"},
}
}

Expand Down Expand Up @@ -187,6 +187,21 @@ func (af *af) WeekdaysWide() []string {
return af.daysWide
}

// Decimal returns the decimal point of number
func (af *af) Decimal() string {
return af.decimal
}

// Group returns the group of number
func (af *af) Group() string {
return af.group
}

// Group returns the minus sign of number
func (af *af) Minus() string {
return af.minus
}

// FmtNumber returns 'num' with digits/precision of 'v' for 'af' and handles both Whole and Real numbers based on 'v'
func (af *af) FmtNumber(num float64, v uint64) string {

Expand Down Expand Up @@ -400,7 +415,7 @@ func (af *af) FmtDateShort(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

b = append(b, []byte{0x2d}...)
Expand Down Expand Up @@ -439,7 +454,7 @@ func (af *af) FmtDateMedium(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand All @@ -462,7 +477,7 @@ func (af *af) FmtDateLong(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand All @@ -488,7 +503,7 @@ func (af *af) FmtDateFull(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand Down
25 changes: 20 additions & 5 deletions af_NA/af_NA.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ func New() locales.Translator {
erasAbbreviated: []string{"v.C.", "n.C."},
erasNarrow: []string{"v.C.", "n.C."},
erasWide: []string{"voor Christus", "na Christus"},
timezones: map[string]string{"HNEG": "Oos-Groenland-standaardtyd", "HEEG": "Oos-Groenland-somertyd", "LHDT": "Lord Howe-dagligtyd", "SRT": "Suriname-tyd", "GYT": "Guyana-tyd", "ADT": "Atlantiese dagligtyd", "EST": "Oostelike standaardtyd", "COST": "Colombië-somertyd", "HNCU": "Kuba-standaardtyd", "WIT": "Oos-Indonesië-tyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "WESZ": "Wes-Europese somertyd", "TMT": "Turkmenistan-standaardtyd", "ACDT": "Australiese sentrale dagligtyd", "AKDT": "Alaska-dagligtyd", "WITA": "Sentraal Indonesië-tyd", "LHST": "Lord Howe-standaardtyd", "WIB": "Wes-Indonesië-tyd", "CST": "Sentrale standaardtyd", "OEZ": "Oos-Europese standaardtyd", "CLST": "Chili-somertyd", "COT": "Colombië-standaardtyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "CDT": "Sentrale dagligtyd", "CAT": "Sentraal-Afrika-tyd", "JDT": "Japan-dagligtyd", "EDT": "Oostelike dagligtyd", "ART": "Argentinië-standaardtyd", "MST": "MST", "ChST": "Chamorro-standaardtyd", "ECT": "Ecuador-tyd", "IST": "Indië-standaardtyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "VET": "Venezuela-tyd", "AWST": "Australiese Westelike standaardtyd", "TMST": "Turkmenistan-somertyd", "AEDT": "Australiese Oostelike dagligtyd", "PST": "Pasifiese standaardtyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "ACST": "Australiese sentraal-standaardtyd", "BT": "Bhoetan-tyd", "GFT": "Frans-Guiana-tyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "CHAST": "Chatham-standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "ARST": "Argentinië-somertyd", "MDT": "MDT", "WAT": "Wes-Afrika-standaardtyd", "WAST": "Wes-Afrika-somertyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "MEZ": "Sentraal-Europese standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "AST": "Atlantiese standaardtyd", "EAT": "Oos-Afrika-tyd", "HKST": "Hongkong-somertyd", "HAT": "Newfoundland-dagligtyd", "SAST": "Suid-Afrika-standaardtyd", "CHADT": "Chatham-dagligtyd", "OESZ": "Oos-Europese somertyd", "HNT": "Newfoundland-standaardtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "NZDT": "Nieu-Seeland-dagligtyd", "MESZ": "Sentraal-Europese somertyd", "HNOG": "Wes-Groenland-standaardtyd", "HEOG": "Wes-Groenland-somertyd", "MYT": "Maleisië-tyd", "AKST": "Alaska-standaardtyd", "UYST": "Uruguay-somertyd", "CLT": "Chili-standaardtyd", "AEST": "Australiese Oostelike standaardtyd", "BOT": "Bolivia-tyd", "WEZ": "Wes-Europese standaardtyd", "GMT": "Greenwich-mediaantyd", "WARST": "Wes-Argentinië-somertyd", "PDT": "Pasifiese dagligtyd", "NZST": "Nieu-Seeland-standaardtyd", "JST": "Japan-standaardtyd", "HKT": "Hongkong-standaardtyd", "HECU": "Kuba-dagligtyd", "∅∅∅": "Brasilië somertyd", "AWDT": "Australiese Westelike dagligtyd", "SGT": "Singapoer-standaardtyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "UYT": "Uruguay-standaardtyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd"},
timezones: map[string]string{"LHDT": "Lord Howe-dagligtyd", "∅∅∅": "Asore-somertyd", "CAT": "Sentraal-Afrika-tyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "WIT": "Oos-Indonesië-tyd", "WEZ": "Wes-Europese standaardtyd", "WAT": "Wes-Afrika-standaardtyd", "HNEG": "Oos-Groenland-standaardtyd", "HAT": "Newfoundland-dagligtyd", "AKST": "Alaska-standaardtyd", "ECT": "Ecuador-tyd", "HNCU": "Kuba-standaardtyd", "HECU": "Kuba-dagligtyd", "BOT": "Bolivia-tyd", "JDT": "Japan-dagligtyd", "COT": "Colombië-standaardtyd", "ACDT": "Australiese sentrale dagligtyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "CHAST": "Chatham-standaardtyd", "TMST": "Turkmenistan-somertyd", "OESZ": "Oos-Europese somertyd", "CLST": "Chili-somertyd", "GFT": "Frans-Guiana-tyd", "WESZ": "Wes-Europese somertyd", "PST": "Pasifiese standaardtyd", "IST": "Indië-standaardtyd", "AEST": "Australiese Oostelike standaardtyd", "CLT": "Chili-standaardtyd", "PDT": "Pasifiese dagligtyd", "AWDT": "Australiese Westelike dagligtyd", "EAT": "Oos-Afrika-tyd", "SGT": "Singapoer-standaardtyd", "NZDT": "Nieu-Seeland-dagligtyd", "HNOG": "Wes-Groenland-standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "HKST": "Hongkong-somertyd", "GMT": "Greenwich-mediaantyd", "UYT": "Uruguay-standaardtyd", "CDT": "Sentrale dagligtyd", "HAST": "Hawaii-Aleusiër-standaardtyd", "AEDT": "Australiese Oostelike dagligtyd", "HEOG": "Wes-Groenland-somertyd", "AKDT": "Alaska-dagligtyd", "ChST": "Chamorro-standaardtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "AST": "Atlantiese standaardtyd", "GYT": "Guyana-tyd", "ACST": "Australiese sentraal-standaardtyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "JST": "Japan-standaardtyd", "OEZ": "Oos-Europese standaardtyd", "MST": "Berg-standaardtyd", "VET": "Venezuela-tyd", "MDT": "Berg-dagligtyd", "EST": "Oostelike standaardtyd", "MESZ": "Sentraal-Europese somertyd", "WAST": "Wes-Afrika-somertyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "AWST": "Australiese Westelike standaardtyd", "MEZ": "Sentraal-Europese standaardtyd", "BT": "Bhoetan-tyd", "ACWST": "Australiese sentraal-Westelike standaard-tyd", "ACWDT": "Australiese sentraal-Westelike dagligtyd", "WARST": "Wes-Argentinië-somertyd", "ADT": "Atlantiese dagligtyd", "ART": "Argentinië-standaardtyd", "ARST": "Argentinië-somertyd", "HNT": "Newfoundland-standaardtyd", "LHST": "Lord Howe-standaardtyd", "EDT": "Oostelike dagligtyd", "WIB": "Wes-Indonesië-tyd", "TMT": "Turkmenistan-standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "WITA": "Sentraal Indonesië-tyd", "WART": "Wes-Argentinië-standaardtyd", "COST": "Colombië-somertyd", "SRT": "Suriname-tyd", "HKT": "Hongkong-standaardtyd", "HADT": "Hawaii-Aleusiër-dagligtyd", "HEEG": "Oos-Groenland-somertyd", "CHADT": "Chatham-dagligtyd", "CST": "Sentrale standaardtyd", "MYT": "Maleisië-tyd", "UYST": "Uruguay-somertyd"},
}
}

Expand Down Expand Up @@ -187,6 +187,21 @@ func (af *af_NA) WeekdaysWide() []string {
return af.daysWide
}

// Decimal returns the decimal point of number
func (af *af_NA) Decimal() string {
return af.decimal
}

// Group returns the group of number
func (af *af_NA) Group() string {
return af.group
}

// Group returns the minus sign of number
func (af *af_NA) Minus() string {
return af.minus
}

// FmtNumber returns 'num' with digits/precision of 'v' for 'af_NA' and handles both Whole and Real numbers based on 'v'
func (af *af_NA) FmtNumber(num float64, v uint64) string {

Expand Down Expand Up @@ -400,7 +415,7 @@ func (af *af_NA) FmtDateShort(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

b = append(b, []byte{0x2d}...)
Expand Down Expand Up @@ -435,7 +450,7 @@ func (af *af_NA) FmtDateMedium(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand All @@ -454,7 +469,7 @@ func (af *af_NA) FmtDateLong(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand All @@ -475,7 +490,7 @@ func (af *af_NA) FmtDateFull(t time.Time) string {
if t.Year() > 0 {
b = strconv.AppendInt(b, int64(t.Year()), 10)
} else {
b = strconv.AppendInt(b, int64(t.Year()*-1), 10)
b = strconv.AppendInt(b, int64(-t.Year()), 10)
}

return string(b)
Expand Down
Loading

0 comments on commit e4cbcb5

Please sign in to comment.