diff --git a/Gopkg.lock b/Gopkg.lock
index 7ae9566a2..8ac5c6de0 100644
--- a/Gopkg.lock
+++ b/Gopkg.lock
@@ -73,6 +73,21 @@
revision = "85dcd8368eba387e65a03488b003e233994e87e9"
version = "v3.3"
+[[projects]]
+ name = "github.com/go-playground/locales"
+ packages = [
+ ".",
+ "currency"
+ ]
+ revision = "f63010822830b6fe52288ee52d5a1151088ce039"
+ version = "v0.12.1"
+
+[[projects]]
+ name = "github.com/go-playground/universal-translator"
+ packages = ["."]
+ revision = "b32fa301c9fe55953584134cb6853a13c87ec0a1"
+ version = "v0.16.0"
+
[[projects]]
name = "github.com/go-test/deep"
packages = ["."]
@@ -343,6 +358,12 @@
]
revision = "1cbadb444a806fd9430d14ad08967ed91da4fa0a"
+[[projects]]
+ name = "gopkg.in/go-playground/validator.v9"
+ packages = ["."]
+ revision = "ab2a8a99087e827c9af87ed6777ba897348fb178"
+ version = "v9.20.2"
+
[[projects]]
branch = "v2"
name = "gopkg.in/yaml.v2"
@@ -352,6 +373,6 @@
[solve-meta]
analyzer-name = "dep"
analyzer-version = 1
- inputs-digest = "0afba7ec3d45c8cf6aea549a9ff30c674c2106f10c8f2865aee452376dcbfbe6"
+ inputs-digest = "a2ddeb1120c832afff8bb9cf48ae85656c0e97f125f0a5d3742152bfb41c04e1"
solver-name = "gps-cdcl"
solver-version = 1
diff --git a/vendor/github.com/go-playground/locales/.gitignore b/vendor/github.com/go-playground/locales/.gitignore
new file mode 100644
index 000000000..daf913b1b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/.gitignore
@@ -0,0 +1,24 @@
+# Compiled Object files, Static and Dynamic libs (Shared Objects)
+*.o
+*.a
+*.so
+
+# Folders
+_obj
+_test
+
+# Architecture specific extensions/prefixes
+*.[568vq]
+[568vq].out
+
+*.cgo1.go
+*.cgo2.c
+_cgo_defun.c
+_cgo_gotypes.go
+_cgo_export.*
+
+_testmain.go
+
+*.exe
+*.test
+*.prof
diff --git a/vendor/github.com/go-playground/locales/LICENSE b/vendor/github.com/go-playground/locales/LICENSE
new file mode 100644
index 000000000..75854ac4f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/LICENSE
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2016 Go Playground
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/README.md b/vendor/github.com/go-playground/locales/README.md
new file mode 100644
index 000000000..43329f8d3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/README.md
@@ -0,0 +1,172 @@
+## locales
+

+[](https://semaphoreci.com/joeybloggs/locales)
+[](https://goreportcard.com/report/github.com/go-playground/locales)
+[](https://godoc.org/github.com/go-playground/locales)
+
+[](https://gitter.im/go-playground/locales?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
+
+Locales is a set of locales generated from the [Unicode CLDR Project](http://cldr.unicode.org/) which can be used independently or within
+an i18n package; these were built for use with, but not exclusive to, [Universal Translator](https://github.com/go-playground/universal-translator).
+
+Features
+--------
+- [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
+- [x] Contains Number, Currency, Accounting and Percent formatting functions
+- [x] Supports the "Gregorian" calendar only ( my time isn't unlimited, had to draw the line somewhere )
+
+Full Tests
+--------------------
+I could sure use your help adding tests for every locale, it is a huge undertaking and I just don't have the free time to do it all at the moment;
+any help would be **greatly appreciated!!!!** please see [issue](https://github.com/go-playground/locales/issues/1) for details.
+
+Installation
+-----------
+
+Use go get
+
+```shell
+go get github.com/go-playground/locales
+```
+
+NOTES
+--------
+You'll notice most return types are []byte, this is because most of the time the results will be concatenated with a larger body
+of text and can avoid some allocations if already appending to a byte array, otherwise just cast as string.
+
+Usage
+-------
+```go
+package main
+
+import (
+ "fmt"
+ "time"
+
+ "github.com/go-playground/locales/currency"
+ "github.com/go-playground/locales/en_CA"
+)
+
+func main() {
+
+ loc, _ := time.LoadLocation("America/Toronto")
+ datetime := time.Date(2016, 02, 03, 9, 0, 1, 0, loc)
+
+ l := en_CA.New()
+
+ // Dates
+ fmt.Println(l.FmtDateFull(datetime))
+ fmt.Println(l.FmtDateLong(datetime))
+ fmt.Println(l.FmtDateMedium(datetime))
+ fmt.Println(l.FmtDateShort(datetime))
+
+ // Times
+ fmt.Println(l.FmtTimeFull(datetime))
+ fmt.Println(l.FmtTimeLong(datetime))
+ fmt.Println(l.FmtTimeMedium(datetime))
+ fmt.Println(l.FmtTimeShort(datetime))
+
+ // Months Wide
+ fmt.Println(l.MonthWide(time.January))
+ fmt.Println(l.MonthWide(time.February))
+ fmt.Println(l.MonthWide(time.March))
+ // ...
+
+ // Months Abbreviated
+ fmt.Println(l.MonthAbbreviated(time.January))
+ fmt.Println(l.MonthAbbreviated(time.February))
+ fmt.Println(l.MonthAbbreviated(time.March))
+ // ...
+
+ // Months Narrow
+ fmt.Println(l.MonthNarrow(time.January))
+ fmt.Println(l.MonthNarrow(time.February))
+ fmt.Println(l.MonthNarrow(time.March))
+ // ...
+
+ // Weekdays Wide
+ fmt.Println(l.WeekdayWide(time.Sunday))
+ fmt.Println(l.WeekdayWide(time.Monday))
+ fmt.Println(l.WeekdayWide(time.Tuesday))
+ // ...
+
+ // Weekdays Abbreviated
+ fmt.Println(l.WeekdayAbbreviated(time.Sunday))
+ fmt.Println(l.WeekdayAbbreviated(time.Monday))
+ fmt.Println(l.WeekdayAbbreviated(time.Tuesday))
+ // ...
+
+ // Weekdays Short
+ fmt.Println(l.WeekdayShort(time.Sunday))
+ fmt.Println(l.WeekdayShort(time.Monday))
+ fmt.Println(l.WeekdayShort(time.Tuesday))
+ // ...
+
+ // Weekdays Narrow
+ fmt.Println(l.WeekdayNarrow(time.Sunday))
+ fmt.Println(l.WeekdayNarrow(time.Monday))
+ fmt.Println(l.WeekdayNarrow(time.Tuesday))
+ // ...
+
+ var f64 float64
+
+ f64 = -10356.4523
+
+ // Number
+ fmt.Println(l.FmtNumber(f64, 2))
+
+ // Currency
+ fmt.Println(l.FmtCurrency(f64, 2, currency.CAD))
+ fmt.Println(l.FmtCurrency(f64, 2, currency.USD))
+
+ // Accounting
+ fmt.Println(l.FmtAccounting(f64, 2, currency.CAD))
+ fmt.Println(l.FmtAccounting(f64, 2, currency.USD))
+
+ f64 = 78.12
+
+ // Percent
+ fmt.Println(l.FmtPercent(f64, 0))
+
+ // Plural Rules for locale, so you know what rules you must cover
+ fmt.Println(l.PluralsCardinal())
+ fmt.Println(l.PluralsOrdinal())
+
+ // Cardinal Plural Rules
+ fmt.Println(l.CardinalPluralRule(1, 0))
+ fmt.Println(l.CardinalPluralRule(1.0, 0))
+ fmt.Println(l.CardinalPluralRule(1.0, 1))
+ fmt.Println(l.CardinalPluralRule(3, 0))
+
+ // Ordinal Plural Rules
+ fmt.Println(l.OrdinalPluralRule(21, 0)) // 21st
+ fmt.Println(l.OrdinalPluralRule(22, 0)) // 22nd
+ fmt.Println(l.OrdinalPluralRule(33, 0)) // 33rd
+ fmt.Println(l.OrdinalPluralRule(34, 0)) // 34th
+
+ // Range Plural Rules
+ fmt.Println(l.RangePluralRule(1, 0, 1, 0)) // 1-1
+ fmt.Println(l.RangePluralRule(1, 0, 2, 0)) // 1-2
+ fmt.Println(l.RangePluralRule(5, 0, 8, 0)) // 5-8
+}
+```
+
+NOTES:
+-------
+These rules were generated from the [Unicode CLDR Project](http://cldr.unicode.org/), if you encounter any issues
+I strongly encourage contributing to the CLDR project to get the locale information corrected and the next time
+these locales are regenerated the fix will come with.
+
+I do however realize that time constraints are often important and so there are two options:
+
+1. Create your own locale, copy, paste and modify, and ensure it complies with the `Translator` interface.
+2. Add an exception in the locale generation code directly and once regenerated, fix will be in place.
+
+Please to not make fixes inside the locale files, they WILL get overwritten when the locales are regenerated.
+
+License
+------
+Distributed under MIT License, please see license file in code for more details.
diff --git a/vendor/github.com/go-playground/locales/af/af.go b/vendor/github.com/go-playground/locales/af/af.go
new file mode 100644
index 000000000..a054c8cc1
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af/af.go
@@ -0,0 +1,628 @@
+package af
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type af struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'af' locale
+func New() locales.Translator {
+ return &af{
+ locale: "af",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "R", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "Mrt.", "Apr.", "Mei", "Jun.", "Jul.", "Aug.", "Sep.", "Okt.", "Nov.", "Des."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januarie", "Februarie", "Maart", "April", "Mei", "Junie", "Julie", "Augustus", "September", "Oktober", "November", "Desember"},
+ daysAbbreviated: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "W", "D", "V", "S"},
+ daysShort: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysWide: []string{"Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag"},
+ periodsAbbreviated: []string{"vm.", "nm."},
+ periodsNarrow: []string{"v", "n"},
+ periodsWide: []string{"vm.", "nm."},
+ erasAbbreviated: []string{"v.C.", "n.C."},
+ erasNarrow: []string{"v.C.", "n.C."},
+ erasWide: []string{"voor Christus", "na Christus"},
+ timezones: map[string]string{"GMT": "Greenwich-tyd", "CHADT": "Chatham-dagligtyd", "CDT": "Noord-Amerikaanse sentrale dagligtyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "GFT": "Frans-Guiana-tyd", "NZDT": "Nieu-Seeland-dagligtyd", "HKST": "Hongkong-somertyd", "LHST": "Lord Howe-standaardtyd", "WITA": "Sentraal-Indonesiese tyd", "CLT": "Chili-standaardtyd", "AST": "Atlantiese standaardtyd", "WAST": "Wes-Afrika-somertyd", "AKDT": "Alaska-dagligtyd", "ACST": "Sentraal-Australiese standaardtyd", "MEZ": "Sentraal-Europese standaardtyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "CLST": "Chili-somertyd", "MST": "Noord-Amerikaanse berg-standaardtyd", "MDT": "Noord-Amerikaanse berg-dagligtyd", "EDT": "Noord-Amerikaanse oostelike dagligtyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "CST": "Noord-Amerikaanse sentrale standaardtyd", "AWST": "Westelike Australiese standaardtyd", "SAST": "Suid-Afrika-standaardtyd", "JDT": "Japan-dagligtyd", "ACDT": "Sentraal-Australiese dagligtyd", "WART": "Wes-Argentinië-standaardtyd", "HNT": "Newfoundland-standaardtyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "TMST": "Turkmenistan-somertyd", "HNCU": "Kuba-standaardtyd", "BT": "Bhoetan-tyd", "UYT": "Uruguay-standaardtyd", "WIB": "Wes-Indonesië-tyd", "HKT": "Hongkong-standaardtyd", "SRT": "Suriname-tyd", "AWDT": "Westelike Australiese dagligtyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "MYT": "Maleisië-tyd", "AKST": "Alaska-standaardtyd", "HNEG": "Oos-Groenland-standaardtyd", "LHDT": "Lord Howe-dagligtyd", "PDT": "Pasifiese dagligtyd", "AEST": "Oostelike Australiese standaardtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "WIT": "Oos-Indonesië-tyd", "UYST": "Uruguay-somertyd", "ADT": "Atlantiese dagligtyd", "BOT": "Bolivia-tyd", "HNOG": "Wes-Groenland-standaardtyd", "HEOG": "Wes-Groenland-somertyd", "EST": "Noord-Amerikaanse oostelike standaardtyd", "ACWST": "Sentraal-westelike Australiese standaard-tyd", "EAT": "Oos-Afrika-tyd", "OESZ": "Oos-Europese somertyd", "COST": "Colombië-somertyd", "WAT": "Wes-Afrika-standaardtyd", "ECT": "Ecuador-tyd", "WARST": "Wes-Argentinië-somertyd", "VET": "Venezuela-tyd", "ARST": "Argentinië-somertyd", "PST": "Pasifiese standaardtyd", "WESZ": "Wes-Europese somertyd", "JST": "Japan-standaardtyd", "IST": "Indië-standaardtyd", "HAST": "Hawaii-Aleoete-standaardtyd", "GYT": "Guyana-tyd", "ChST": "Chamorro-standaardtyd", "HECU": "Kuba-dagligtyd", "AEDT": "Oostelike Australiese dagligtyd", "MESZ": "Sentraal-Europese somertyd", "OEZ": "Oos-Europese standaardtyd", "ART": "Argentinië-standaardtyd", "ACWDT": "Sentraal-westelike Australiese dagligtyd", "HEEG": "Oos-Groenland-somertyd", "HAT": "Newfoundland-dagligtyd", "TMT": "Turkmenistan-standaardtyd", "CAT": "Sentraal-Afrika-tyd", "CHAST": "Chatham-standaardtyd", "∅∅∅": "Brasilia-somertyd", "WEZ": "Wes-Europese standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "SGT": "Singapoer-standaardtyd", "HADT": "Hawaii-Aleoete-dagligtyd", "COT": "Colombië-standaardtyd"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (af *af) Locale() string {
+ return af.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'af'
+func (af *af) PluralsCardinal() []locales.PluralRule {
+ return af.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'af'
+func (af *af) PluralsOrdinal() []locales.PluralRule {
+ return af.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'af'
+func (af *af) PluralsRange() []locales.PluralRule {
+ return af.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'af'
+func (af *af) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'af'
+func (af *af) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'af'
+func (af *af) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (af *af) MonthAbbreviated(month time.Month) string {
+ return af.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (af *af) MonthsAbbreviated() []string {
+ return af.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (af *af) MonthNarrow(month time.Month) string {
+ return af.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (af *af) MonthsNarrow() []string {
+ return af.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (af *af) MonthWide(month time.Month) string {
+ return af.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (af *af) MonthsWide() []string {
+ return af.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (af *af) WeekdayAbbreviated(weekday time.Weekday) string {
+ return af.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (af *af) WeekdaysAbbreviated() []string {
+ return af.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (af *af) WeekdayNarrow(weekday time.Weekday) string {
+ return af.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (af *af) WeekdaysNarrow() []string {
+ return af.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (af *af) WeekdayShort(weekday time.Weekday) string {
+ return af.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (af *af) WeekdaysShort() []string {
+ return af.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (af *af) WeekdayWide(weekday time.Weekday) string {
+ return af.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+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 {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'af' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (af *af) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, af.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'af'
+func (af *af) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'af'
+// in accounting notation.
+func (af *af) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, af.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, af.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'af'
+func (af *af) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'af'
+func (af *af) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'af'
+func (af *af) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'af'
+func (af *af) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, af.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'af'
+func (af *af) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'af'
+func (af *af) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'af'
+func (af *af) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'af'
+func (af *af) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := af.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/af/af_test.go b/vendor/github.com/go-playground/locales/af/af_test.go
new file mode 100644
index 000000000..84a36153e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af/af_test.go
@@ -0,0 +1,1120 @@
+package af
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/af_NA/af_NA.go b/vendor/github.com/go-playground/locales/af_NA/af_NA.go
new file mode 100644
index 000000000..316f16423
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af_NA/af_NA.go
@@ -0,0 +1,615 @@
+package af_NA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type af_NA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'af_NA' locale
+func New() locales.Translator {
+ return &af_NA{
+ locale: "af_NA",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "$", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "Mrt.", "Apr.", "Mei", "Jun.", "Jul.", "Aug.", "Sep.", "Okt.", "Nov.", "Des."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januarie", "Februarie", "Maart", "April", "Mei", "Junie", "Julie", "Augustus", "September", "Oktober", "November", "Desember"},
+ daysAbbreviated: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "W", "D", "V", "S"},
+ daysShort: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysWide: []string{"Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag"},
+ periodsAbbreviated: []string{"vm.", "nm."},
+ periodsNarrow: []string{"v", "n"},
+ periodsWide: []string{"vm.", "nm."},
+ erasAbbreviated: []string{"v.C.", "n.C."},
+ erasNarrow: []string{"v.C.", "n.C."},
+ erasWide: []string{"voor Christus", "na Christus"},
+ timezones: map[string]string{"AWDT": "Westelike Australiese dagligtyd", "AST": "Atlantiese standaardtyd", "EDT": "Noord-Amerikaanse oostelike dagligtyd", "ACWDT": "Sentraal-westelike Australiese dagligtyd", "MESZ": "Sentraal-Europese somertyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "ART": "Argentinië-standaardtyd", "ChST": "Chamorro-standaardtyd", "SRT": "Suriname-tyd", "CLT": "Chili-standaardtyd", "AEST": "Oostelike Australiese standaardtyd", "AEDT": "Oostelike Australiese dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "BOT": "Bolivia-tyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "MST": "MST", "ACWST": "Sentraal-westelike Australiese standaard-tyd", "HKST": "Hongkong-somertyd", "CDT": "Noord-Amerikaanse sentrale dagligtyd", "ECT": "Ecuador-tyd", "HEEG": "Oos-Groenland-somertyd", "WIT": "Oos-Indonesië-tyd", "OESZ": "Oos-Europese somertyd", "EST": "Noord-Amerikaanse oostelike standaardtyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "NZDT": "Nieu-Seeland-dagligtyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "WESZ": "Wes-Europese somertyd", "HEOG": "Wes-Groenland-somertyd", "MEZ": "Sentraal-Europese standaardtyd", "HKT": "Hongkong-standaardtyd", "GMT": "Greenwich-tyd", "HECU": "Kuba-dagligtyd", "AKST": "Alaska-standaardtyd", "COT": "Colombië-standaardtyd", "CHAST": "Chatham-standaardtyd", "PST": "Pasifiese standaardtyd", "AWST": "Westelike Australiese standaardtyd", "ADT": "Atlantiese dagligtyd", "SAST": "Suid-Afrika-standaardtyd", "WARST": "Wes-Argentinië-somertyd", "CLST": "Chili-somertyd", "TMT": "Turkmenistan-standaardtyd", "SGT": "Singapoer-standaardtyd", "HADT": "Hawaii-Aleoete-dagligtyd", "GYT": "Guyana-tyd", "WIB": "Wes-Indonesië-tyd", "HNEG": "Oos-Groenland-standaardtyd", "LHST": "Lord Howe-standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "OEZ": "Oos-Europese standaardtyd", "∅∅∅": "Amasone-somertyd", "CST": "Noord-Amerikaanse sentrale standaardtyd", "CHADT": "Chatham-dagligtyd", "HNCU": "Kuba-standaardtyd", "ACDT": "Sentraal-Australiese dagligtyd", "HAT": "Newfoundland-dagligtyd", "VET": "Venezuela-tyd", "UYST": "Uruguay-somertyd", "BT": "Bhoetan-tyd", "WAST": "Wes-Afrika-somertyd", "JST": "Japan-standaardtyd", "MYT": "Maleisië-tyd", "HNOG": "Wes-Groenland-standaardtyd", "IST": "Indië-standaardtyd", "LHDT": "Lord Howe-dagligtyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "CAT": "Sentraal-Afrika-tyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "PDT": "Pasifiese dagligtyd", "EAT": "Oos-Afrika-tyd", "HAST": "Hawaii-Aleoete-standaardtyd", "ARST": "Argentinië-somertyd", "HNT": "Newfoundland-standaardtyd", "MDT": "MDT", "TMST": "Turkmenistan-somertyd", "NZST": "Nieu-Seeland-standaardtyd", "WITA": "Sentraal-Indonesiese tyd", "COST": "Colombië-somertyd", "WEZ": "Wes-Europese standaardtyd", "GFT": "Frans-Guiana-tyd", "AKDT": "Alaska-dagligtyd", "ACST": "Sentraal-Australiese standaardtyd", "UYT": "Uruguay-standaardtyd", "JDT": "Japan-dagligtyd"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (af *af_NA) Locale() string {
+ return af.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'af_NA'
+func (af *af_NA) PluralsCardinal() []locales.PluralRule {
+ return af.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'af_NA'
+func (af *af_NA) PluralsOrdinal() []locales.PluralRule {
+ return af.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'af_NA'
+func (af *af_NA) PluralsRange() []locales.PluralRule {
+ return af.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'af_NA'
+func (af *af_NA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'af_NA'
+func (af *af_NA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'af_NA'
+func (af *af_NA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (af *af_NA) MonthAbbreviated(month time.Month) string {
+ return af.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (af *af_NA) MonthsAbbreviated() []string {
+ return af.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (af *af_NA) MonthNarrow(month time.Month) string {
+ return af.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (af *af_NA) MonthsNarrow() []string {
+ return af.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (af *af_NA) MonthWide(month time.Month) string {
+ return af.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (af *af_NA) MonthsWide() []string {
+ return af.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (af *af_NA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return af.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (af *af_NA) WeekdaysAbbreviated() []string {
+ return af.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (af *af_NA) WeekdayNarrow(weekday time.Weekday) string {
+ return af.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (af *af_NA) WeekdaysNarrow() []string {
+ return af.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (af *af_NA) WeekdayShort(weekday time.Weekday) string {
+ return af.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (af *af_NA) WeekdaysShort() []string {
+ return af.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (af *af_NA) WeekdayWide(weekday time.Weekday) string {
+ return af.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+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 {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'af_NA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (af *af_NA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, af.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'af_NA'
+func (af *af_NA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'af_NA'
+// in accounting notation.
+func (af *af_NA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, af.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, af.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'af_NA'
+func (af *af_NA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'af_NA'
+func (af *af_NA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'af_NA'
+func (af *af_NA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'af_NA'
+func (af *af_NA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, af.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'af_NA'
+func (af *af_NA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'af_NA'
+func (af *af_NA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'af_NA'
+func (af *af_NA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'af_NA'
+func (af *af_NA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := af.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/af_NA/af_NA_test.go b/vendor/github.com/go-playground/locales/af_NA/af_NA_test.go
new file mode 100644
index 000000000..ce7baee0a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af_NA/af_NA_test.go
@@ -0,0 +1,1120 @@
+package af_NA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af_NA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/af_ZA/af_ZA.go b/vendor/github.com/go-playground/locales/af_ZA/af_ZA.go
new file mode 100644
index 000000000..e220ec92e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af_ZA/af_ZA.go
@@ -0,0 +1,628 @@
+package af_ZA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type af_ZA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'af_ZA' locale
+func New() locales.Translator {
+ return &af_ZA{
+ locale: "af_ZA",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "Mrt.", "Apr.", "Mei", "Jun.", "Jul.", "Aug.", "Sep.", "Okt.", "Nov.", "Des."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januarie", "Februarie", "Maart", "April", "Mei", "Junie", "Julie", "Augustus", "September", "Oktober", "November", "Desember"},
+ daysAbbreviated: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "W", "D", "V", "S"},
+ daysShort: []string{"So.", "Ma.", "Di.", "Wo.", "Do.", "Vr.", "Sa."},
+ daysWide: []string{"Sondag", "Maandag", "Dinsdag", "Woensdag", "Donderdag", "Vrydag", "Saterdag"},
+ periodsAbbreviated: []string{"vm.", "nm."},
+ periodsNarrow: []string{"v", "n"},
+ periodsWide: []string{"vm.", "nm."},
+ erasAbbreviated: []string{"v.C.", "n.C."},
+ erasNarrow: []string{"v.C.", "n.C."},
+ erasWide: []string{"voor Christus", "na Christus"},
+ timezones: map[string]string{"TMST": "Turkmenistan-somertyd", "ARST": "Argentinië-somertyd", "BOT": "Bolivia-tyd", "AEDT": "Oostelike Australiese dagligtyd", "WAT": "Wes-Afrika-standaardtyd", "JDT": "Japan-dagligtyd", "CLT": "Chili-standaardtyd", "OESZ": "Oos-Europese somertyd", "GYT": "Guyana-tyd", "PDT": "Pasifiese dagligtyd", "HNPMX": "Meksikaanse Pasifiese standaardtyd", "NZST": "Nieu-Seeland-standaardtyd", "EST": "Noord-Amerikaanse oostelike standaardtyd", "WART": "Wes-Argentinië-standaardtyd", "ChST": "Chamorro-standaardtyd", "BT": "Bhoetan-tyd", "ACWST": "Sentraal-westelike Australiese standaard-tyd", "HEEG": "Oos-Groenland-somertyd", "MST": "MST", "CAT": "Sentraal-Afrika-tyd", "TMT": "Turkmenistan-standaardtyd", "COST": "Colombië-somertyd", "CST": "Noord-Amerikaanse sentrale standaardtyd", "HADT": "Hawaii-Aleoete-dagligtyd", "∅∅∅": "Amasone-somertyd", "AKDT": "Alaska-dagligtyd", "MESZ": "Sentraal-Europese somertyd", "LHST": "Lord Howe-standaardtyd", "MDT": "MDT", "OEZ": "Oos-Europese standaardtyd", "UYST": "Uruguay-somertyd", "SAST": "Suid-Afrika-standaardtyd", "WAST": "Wes-Afrika-somertyd", "HAT": "Newfoundland-dagligtyd", "PST": "Pasifiese standaardtyd", "WEZ": "Wes-Europese standaardtyd", "AKST": "Alaska-standaardtyd", "SGT": "Singapoer-standaardtyd", "HNOG": "Wes-Groenland-standaardtyd", "HEPMX": "Meksikaanse Pasifiese dagligtyd", "MYT": "Maleisië-tyd", "HAST": "Hawaii-Aleoete-standaardtyd", "AWDT": "Westelike Australiese dagligtyd", "VET": "Venezuela-tyd", "HNPM": "Sint-Pierre en Miquelon-standaardtyd", "HEPM": "Sint-Pierre en Miquelon-dagligtyd", "CHADT": "Chatham-dagligtyd", "HECU": "Kuba-dagligtyd", "AEST": "Oostelike Australiese standaardtyd", "HNEG": "Oos-Groenland-standaardtyd", "WARST": "Wes-Argentinië-somertyd", "MEZ": "Sentraal-Europese standaardtyd", "SRT": "Suriname-tyd", "WIT": "Oos-Indonesië-tyd", "UYT": "Uruguay-standaardtyd", "HNCU": "Kuba-standaardtyd", "AST": "Atlantiese standaardtyd", "WESZ": "Wes-Europese somertyd", "JST": "Japan-standaardtyd", "GFT": "Frans-Guiana-tyd", "ACWDT": "Sentraal-westelike Australiese dagligtyd", "WITA": "Sentraal-Indonesiese tyd", "ACDT": "Sentraal-Australiese dagligtyd", "HEOG": "Wes-Groenland-somertyd", "HKT": "Hongkong-standaardtyd", "HNNOMX": "Noordwes-Meksiko-standaardtyd", "EAT": "Oos-Afrika-tyd", "ART": "Argentinië-standaardtyd", "NZDT": "Nieu-Seeland-dagligtyd", "EDT": "Noord-Amerikaanse oostelike dagligtyd", "HKST": "Hongkong-somertyd", "IST": "Indië-standaardtyd", "LHDT": "Lord Howe-dagligtyd", "HENOMX": "Noordwes-Meksiko-dagligtyd", "GMT": "Greenwich-tyd", "CHAST": "Chatham-standaardtyd", "CDT": "Noord-Amerikaanse sentrale dagligtyd", "ECT": "Ecuador-tyd", "ACST": "Sentraal-Australiese standaardtyd", "HNT": "Newfoundland-standaardtyd", "CLST": "Chili-somertyd", "COT": "Colombië-standaardtyd", "AWST": "Westelike Australiese standaardtyd", "ADT": "Atlantiese dagligtyd", "WIB": "Wes-Indonesië-tyd"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (af *af_ZA) Locale() string {
+ return af.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'af_ZA'
+func (af *af_ZA) PluralsCardinal() []locales.PluralRule {
+ return af.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'af_ZA'
+func (af *af_ZA) PluralsOrdinal() []locales.PluralRule {
+ return af.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'af_ZA'
+func (af *af_ZA) PluralsRange() []locales.PluralRule {
+ return af.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'af_ZA'
+func (af *af_ZA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'af_ZA'
+func (af *af_ZA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'af_ZA'
+func (af *af_ZA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (af *af_ZA) MonthAbbreviated(month time.Month) string {
+ return af.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (af *af_ZA) MonthsAbbreviated() []string {
+ return af.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (af *af_ZA) MonthNarrow(month time.Month) string {
+ return af.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (af *af_ZA) MonthsNarrow() []string {
+ return af.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (af *af_ZA) MonthWide(month time.Month) string {
+ return af.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (af *af_ZA) MonthsWide() []string {
+ return af.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (af *af_ZA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return af.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (af *af_ZA) WeekdaysAbbreviated() []string {
+ return af.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (af *af_ZA) WeekdayNarrow(weekday time.Weekday) string {
+ return af.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (af *af_ZA) WeekdaysNarrow() []string {
+ return af.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (af *af_ZA) WeekdayShort(weekday time.Weekday) string {
+ return af.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (af *af_ZA) WeekdaysShort() []string {
+ return af.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (af *af_ZA) WeekdayWide(weekday time.Weekday) string {
+ return af.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (af *af_ZA) WeekdaysWide() []string {
+ return af.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (af *af_ZA) Decimal() string {
+ return af.decimal
+}
+
+// Group returns the group of number
+func (af *af_ZA) Group() string {
+ return af.group
+}
+
+// Group returns the minus sign of number
+func (af *af_ZA) Minus() string {
+ return af.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'af_ZA' and handles both Whole and Real numbers based on 'v'
+func (af *af_ZA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'af_ZA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (af *af_ZA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, af.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'af_ZA'
+func (af *af_ZA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, af.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'af_ZA'
+// in accounting notation.
+func (af *af_ZA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := af.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, af.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(af.group) - 1; j >= 0; j-- {
+ b = append(b, af.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, af.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, af.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, af.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, af.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, af.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'af_ZA'
+func (af *af_ZA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, af.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := af.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/af_ZA/af_ZA_test.go b/vendor/github.com/go-playground/locales/af_ZA/af_ZA_test.go
new file mode 100644
index 000000000..67ed4c668
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/af_ZA/af_ZA_test.go
@@ -0,0 +1,1120 @@
+package af_ZA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "af_ZA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/agq/agq.go b/vendor/github.com/go-playground/locales/agq/agq.go
new file mode 100644
index 000000000..ed1653e94
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/agq/agq.go
@@ -0,0 +1,578 @@
+package agq
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type agq struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'agq' locale
+func New() locales.Translator {
+ return &agq{
+ locale: "agq",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "nùm", "kɨz", "tɨd", "taa", "see", "nzu", "dum", "fɔe", "dzu", "lɔm", "kaa", "fwo"},
+ monthsNarrow: []string{"", "n", "k", "t", "t", "s", "z", "k", "f", "d", "l", "c", "f"},
+ monthsWide: []string{"", "ndzɔ̀ŋɔ̀nùm", "ndzɔ̀ŋɔ̀kƗ̀zùʔ", "ndzɔ̀ŋɔ̀tƗ̀dʉ̀ghà", "ndzɔ̀ŋɔ̀tǎafʉ̄ghā", "ndzɔ̀ŋèsèe", "ndzɔ̀ŋɔ̀nzùghò", "ndzɔ̀ŋɔ̀dùmlo", "ndzɔ̀ŋɔ̀kwîfɔ̀e", "ndzɔ̀ŋɔ̀tƗ̀fʉ̀ghàdzughù", "ndzɔ̀ŋɔ̀ghǔuwelɔ̀m", "ndzɔ̀ŋɔ̀chwaʔàkaa wo", "ndzɔ̀ŋèfwòo"},
+ daysAbbreviated: []string{"nts", "kpa", "ghɔ", "tɔm", "ume", "ghɨ", "dzk"},
+ daysNarrow: []string{"n", "k", "g", "t", "u", "g", "d"},
+ daysWide: []string{"tsuʔntsɨ", "tsuʔukpà", "tsuʔughɔe", "tsuʔutɔ̀mlò", "tsuʔumè", "tsuʔughɨ̂m", "tsuʔndzɨkɔʔɔ"},
+ periodsAbbreviated: []string{"a.g", "a.k"},
+ periodsWide: []string{"a.g", "a.k"},
+ erasAbbreviated: []string{"SK", "BK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Sěe Kɨ̀lesto", "Bǎa Kɨ̀lesto"},
+ timezones: map[string]string{"MST": "MST", "MDT": "MDT", "CHADT": "CHADT", "HNCU": "HNCU", "CST": "CST", "MESZ": "MESZ", "HNNOMX": "HNNOMX", "WEZ": "WEZ", "MYT": "MYT", "BOT": "BOT", "CLT": "CLT", "MEZ": "MEZ", "CHAST": "CHAST", "PDT": "PDT", "WIB": "WIB", "JST": "JST", "HEPM": "HEPM", "CAT": "CAT", "∅∅∅": "∅∅∅", "NZST": "NZST", "EST": "EST", "LHDT": "LHDT", "HNT": "HNT", "WIT": "WIT", "GYT": "GYT", "HECU": "HECU", "SAST": "SAST", "WESZ": "WESZ", "LHST": "LHST", "OESZ": "OESZ", "HEPMX": "HEPMX", "AST": "AST", "ACST": "ACST", "ACDT": "ACDT", "ACWST": "ACWST", "WARST": "WARST", "TMST": "TMST", "ChST": "ChST", "AWST": "AWST", "GFT": "GFT", "HEOG": "HEOG", "GMT": "GMT", "AEDT": "AEDT", "JDT": "JDT", "AKST": "AKST", "ECT": "ECT", "EDT": "EDT", "ACWDT": "ACWDT", "WITA": "WITA", "HENOMX": "HENOMX", "UYST": "UYST", "AWDT": "AWDT", "HKST": "HKST", "WART": "WART", "HNPM": "HNPM", "ARST": "ARST", "COST": "COST", "AEST": "AEST", "HNEG": "HNEG", "HEEG": "HEEG", "HKT": "HKT", "IST": "IST", "VET": "VET", "EAT": "EAT", "HADT": "HADT", "UYT": "UYT", "PST": "PST", "HNPMX": "HNPMX", "AKDT": "AKDT", "SGT": "SGT", "COT": "COT", "WAT": "WAT", "SRT": "SRT", "HNOG": "HNOG", "HAT": "HAT", "OEZ": "OEZ", "CDT": "CDT", "WAST": "WAST", "BT": "BT", "CLST": "CLST", "TMT": "TMT", "HAST": "HAST", "ART": "ART", "ADT": "ADT", "NZDT": "NZDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (agq *agq) Locale() string {
+ return agq.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'agq'
+func (agq *agq) PluralsCardinal() []locales.PluralRule {
+ return agq.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'agq'
+func (agq *agq) PluralsOrdinal() []locales.PluralRule {
+ return agq.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'agq'
+func (agq *agq) PluralsRange() []locales.PluralRule {
+ return agq.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'agq'
+func (agq *agq) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'agq'
+func (agq *agq) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'agq'
+func (agq *agq) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (agq *agq) MonthAbbreviated(month time.Month) string {
+ return agq.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (agq *agq) MonthsAbbreviated() []string {
+ return agq.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (agq *agq) MonthNarrow(month time.Month) string {
+ return agq.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (agq *agq) MonthsNarrow() []string {
+ return agq.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (agq *agq) MonthWide(month time.Month) string {
+ return agq.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (agq *agq) MonthsWide() []string {
+ return agq.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (agq *agq) WeekdayAbbreviated(weekday time.Weekday) string {
+ return agq.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (agq *agq) WeekdaysAbbreviated() []string {
+ return agq.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (agq *agq) WeekdayNarrow(weekday time.Weekday) string {
+ return agq.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (agq *agq) WeekdaysNarrow() []string {
+ return agq.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (agq *agq) WeekdayShort(weekday time.Weekday) string {
+ return agq.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (agq *agq) WeekdaysShort() []string {
+ return agq.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (agq *agq) WeekdayWide(weekday time.Weekday) string {
+ return agq.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (agq *agq) WeekdaysWide() []string {
+ return agq.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (agq *agq) Decimal() string {
+ return agq.decimal
+}
+
+// Group returns the group of number
+func (agq *agq) Group() string {
+ return agq.group
+}
+
+// Group returns the minus sign of number
+func (agq *agq) Minus() string {
+ return agq.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'agq' and handles both Whole and Real numbers based on 'v'
+func (agq *agq) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'agq' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (agq *agq) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, agq.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'agq'
+func (agq *agq) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := agq.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, agq.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'agq'
+// in accounting notation.
+func (agq *agq) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := agq.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, agq.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, agq.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'agq'
+func (agq *agq) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'agq'
+func (agq *agq) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'agq'
+func (agq *agq) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'agq'
+func (agq *agq) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, agq.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'agq'
+func (agq *agq) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'agq'
+func (agq *agq) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'agq'
+func (agq *agq) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'agq'
+func (agq *agq) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := agq.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/agq/agq_test.go b/vendor/github.com/go-playground/locales/agq/agq_test.go
new file mode 100644
index 000000000..cb5082d58
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/agq/agq_test.go
@@ -0,0 +1,1120 @@
+package agq
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "agq"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/agq_CM/agq_CM.go b/vendor/github.com/go-playground/locales/agq_CM/agq_CM.go
new file mode 100644
index 000000000..cb9c96a68
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/agq_CM/agq_CM.go
@@ -0,0 +1,578 @@
+package agq_CM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type agq_CM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'agq_CM' locale
+func New() locales.Translator {
+ return &agq_CM{
+ locale: "agq_CM",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "nùm", "kɨz", "tɨd", "taa", "see", "nzu", "dum", "fɔe", "dzu", "lɔm", "kaa", "fwo"},
+ monthsNarrow: []string{"", "n", "k", "t", "t", "s", "z", "k", "f", "d", "l", "c", "f"},
+ monthsWide: []string{"", "ndzɔ̀ŋɔ̀nùm", "ndzɔ̀ŋɔ̀kƗ̀zùʔ", "ndzɔ̀ŋɔ̀tƗ̀dʉ̀ghà", "ndzɔ̀ŋɔ̀tǎafʉ̄ghā", "ndzɔ̀ŋèsèe", "ndzɔ̀ŋɔ̀nzùghò", "ndzɔ̀ŋɔ̀dùmlo", "ndzɔ̀ŋɔ̀kwîfɔ̀e", "ndzɔ̀ŋɔ̀tƗ̀fʉ̀ghàdzughù", "ndzɔ̀ŋɔ̀ghǔuwelɔ̀m", "ndzɔ̀ŋɔ̀chwaʔàkaa wo", "ndzɔ̀ŋèfwòo"},
+ daysAbbreviated: []string{"nts", "kpa", "ghɔ", "tɔm", "ume", "ghɨ", "dzk"},
+ daysNarrow: []string{"n", "k", "g", "t", "u", "g", "d"},
+ daysWide: []string{"tsuʔntsɨ", "tsuʔukpà", "tsuʔughɔe", "tsuʔutɔ̀mlò", "tsuʔumè", "tsuʔughɨ̂m", "tsuʔndzɨkɔʔɔ"},
+ periodsAbbreviated: []string{"a.g", "a.k"},
+ periodsWide: []string{"a.g", "a.k"},
+ erasAbbreviated: []string{"SK", "BK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Sěe Kɨ̀lesto", "Bǎa Kɨ̀lesto"},
+ timezones: map[string]string{"VET": "VET", "HEPM": "HEPM", "HNCU": "HNCU", "AKDT": "AKDT", "HKST": "HKST", "WITA": "WITA", "MST": "MST", "HECU": "HECU", "SGT": "SGT", "NZST": "NZST", "JST": "JST", "ACWDT": "ACWDT", "MEZ": "MEZ", "CHADT": "CHADT", "HEPMX": "HEPMX", "AEDT": "AEDT", "ACST": "ACST", "ARST": "ARST", "WIB": "WIB", "BT": "BT", "BOT": "BOT", "HNNOMX": "HNNOMX", "OEZ": "OEZ", "UYST": "UYST", "WAT": "WAT", "CST": "CST", "HNPMX": "HNPMX", "WIT": "WIT", "TMT": "TMT", "GYT": "GYT", "WESZ": "WESZ", "ChST": "ChST", "PST": "PST", "AEST": "AEST", "CDT": "CDT", "AST": "AST", "ACDT": "ACDT", "WART": "WART", "WARST": "WARST", "CLST": "CLST", "HAST": "HAST", "UYT": "UYT", "LHDT": "LHDT", "HENOMX": "HENOMX", "GMT": "GMT", "SAST": "SAST", "EDT": "EDT", "CLT": "CLT", "AWDT": "AWDT", "∅∅∅": "∅∅∅", "JDT": "JDT", "AKST": "AKST", "LHST": "LHST", "TMST": "TMST", "ART": "ART", "COT": "COT", "ECT": "ECT", "HEOG": "HEOG", "HAT": "HAT", "EAT": "EAT", "COST": "COST", "GFT": "GFT", "EST": "EST", "PDT": "PDT", "NZDT": "NZDT", "MYT": "MYT", "ADT": "ADT", "WAST": "WAST", "ACWST": "ACWST", "HEEG": "HEEG", "HNOG": "HNOG", "SRT": "SRT", "OESZ": "OESZ", "AWST": "AWST", "HKT": "HKT", "HNT": "HNT", "IST": "IST", "CAT": "CAT", "CHAST": "CHAST", "WEZ": "WEZ", "MESZ": "MESZ", "HNPM": "HNPM", "MDT": "MDT", "HADT": "HADT", "HNEG": "HNEG"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (agq *agq_CM) Locale() string {
+ return agq.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'agq_CM'
+func (agq *agq_CM) PluralsCardinal() []locales.PluralRule {
+ return agq.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'agq_CM'
+func (agq *agq_CM) PluralsOrdinal() []locales.PluralRule {
+ return agq.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'agq_CM'
+func (agq *agq_CM) PluralsRange() []locales.PluralRule {
+ return agq.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'agq_CM'
+func (agq *agq_CM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'agq_CM'
+func (agq *agq_CM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'agq_CM'
+func (agq *agq_CM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (agq *agq_CM) MonthAbbreviated(month time.Month) string {
+ return agq.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (agq *agq_CM) MonthsAbbreviated() []string {
+ return agq.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (agq *agq_CM) MonthNarrow(month time.Month) string {
+ return agq.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (agq *agq_CM) MonthsNarrow() []string {
+ return agq.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (agq *agq_CM) MonthWide(month time.Month) string {
+ return agq.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (agq *agq_CM) MonthsWide() []string {
+ return agq.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (agq *agq_CM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return agq.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (agq *agq_CM) WeekdaysAbbreviated() []string {
+ return agq.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (agq *agq_CM) WeekdayNarrow(weekday time.Weekday) string {
+ return agq.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (agq *agq_CM) WeekdaysNarrow() []string {
+ return agq.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (agq *agq_CM) WeekdayShort(weekday time.Weekday) string {
+ return agq.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (agq *agq_CM) WeekdaysShort() []string {
+ return agq.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (agq *agq_CM) WeekdayWide(weekday time.Weekday) string {
+ return agq.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (agq *agq_CM) WeekdaysWide() []string {
+ return agq.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (agq *agq_CM) Decimal() string {
+ return agq.decimal
+}
+
+// Group returns the group of number
+func (agq *agq_CM) Group() string {
+ return agq.group
+}
+
+// Group returns the minus sign of number
+func (agq *agq_CM) Minus() string {
+ return agq.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'agq_CM' and handles both Whole and Real numbers based on 'v'
+func (agq *agq_CM) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'agq_CM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (agq *agq_CM) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, agq.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'agq_CM'
+func (agq *agq_CM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := agq.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, agq.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, agq.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'agq_CM'
+// in accounting notation.
+func (agq *agq_CM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := agq.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, agq.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(agq.group) - 1; j >= 0; j-- {
+ b = append(b, agq.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, agq.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, agq.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, agq.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, agq.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'agq_CM'
+func (agq *agq_CM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, agq.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := agq.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/agq_CM/agq_CM_test.go b/vendor/github.com/go-playground/locales/agq_CM/agq_CM_test.go
new file mode 100644
index 000000000..bf4e46300
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/agq_CM/agq_CM_test.go
@@ -0,0 +1,1120 @@
+package agq_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "agq_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ak/ak.go b/vendor/github.com/go-playground/locales/ak/ak.go
new file mode 100644
index 000000000..775d052d4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ak/ak.go
@@ -0,0 +1,578 @@
+package ak
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ak struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ak' locale
+func New() locales.Translator {
+ return &ak{
+ locale: "ak",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ".",
+ group: ",",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GH₵", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "S-Ɔ", "K-Ɔ", "E-Ɔ", "E-O", "E-K", "O-A", "A-K", "D-Ɔ", "F-Ɛ", "Ɔ-A", "Ɔ-O", "M-Ɔ"},
+ monthsWide: []string{"", "Sanda-Ɔpɛpɔn", "Kwakwar-Ɔgyefuo", "Ebɔw-Ɔbenem", "Ebɔbira-Oforisuo", "Esusow Aketseaba-Kɔtɔnimba", "Obirade-Ayɛwohomumu", "Ayɛwoho-Kitawonsa", "Difuu-Ɔsandaa", "Fankwa-Ɛbɔ", "Ɔbɛsɛ-Ahinime", "Ɔberɛfɛw-Obubuo", "Mumu-Ɔpɛnimba"},
+ daysAbbreviated: []string{"Kwe", "Dwo", "Ben", "Wuk", "Yaw", "Fia", "Mem"},
+ daysNarrow: []string{"K", "D", "B", "W", "Y", "F", "M"},
+ daysWide: []string{"Kwesida", "Dwowda", "Benada", "Wukuda", "Yawda", "Fida", "Memeneda"},
+ periodsAbbreviated: []string{"AN", "EW"},
+ periodsWide: []string{"AN", "EW"},
+ erasAbbreviated: []string{"AK", "KE"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ansa Kristo", "Kristo Ekyiri"},
+ timezones: map[string]string{"PDT": "PDT", "HNPMX": "HNPMX", "AEST": "AEST", "AEDT": "AEDT", "JDT": "JDT", "MST": "MST", "BT": "BT", "HNEG": "HNEG", "HNOG": "HNOG", "HKST": "HKST", "HAST": "HAST", "EST": "EST", "EDT": "EDT", "ACWDT": "ACWDT", "LHDT": "LHDT", "WITA": "WITA", "CLT": "CLT", "HADT": "HADT", "CHADT": "CHADT", "CDT": "CDT", "SAST": "SAST", "HENOMX": "HENOMX", "CHAST": "CHAST", "LHST": "LHST", "VET": "VET", "ARST": "ARST", "COT": "COT", "TMST": "TMST", "OESZ": "OESZ", "GMT": "GMT", "UYT": "UYT", "ChST": "ChST", "BOT": "BOT", "CAT": "CAT", "UYST": "UYST", "AWDT": "AWDT", "WESZ": "WESZ", "MYT": "MYT", "ACWST": "ACWST", "COST": "COST", "WIT": "WIT", "ART": "ART", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "ACDT": "ACDT", "HNPM": "HNPM", "MDT": "MDT", "SGT": "SGT", "WARST": "WARST", "AWST": "AWST", "PST": "PST", "NZST": "NZST", "GFT": "GFT", "AKST": "AKST", "HECU": "HECU", "EAT": "EAT", "AST": "AST", "WIB": "WIB", "AKDT": "AKDT", "HEEG": "HEEG", "MEZ": "MEZ", "HNT": "HNT", "HNNOMX": "HNNOMX", "HEPMX": "HEPMX", "ADT": "ADT", "ECT": "ECT", "HKT": "HKT", "IST": "IST", "HEPM": "HEPM", "CLST": "CLST", "HNCU": "HNCU", "CST": "CST", "WAST": "WAST", "ACST": "ACST", "MESZ": "MESZ", "WART": "WART", "OEZ": "OEZ", "TMT": "TMT", "GYT": "GYT", "WAT": "WAT", "WEZ": "WEZ", "JST": "JST", "HEOG": "HEOG", "HAT": "HAT", "SRT": "SRT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ak *ak) Locale() string {
+ return ak.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ak'
+func (ak *ak) PluralsCardinal() []locales.PluralRule {
+ return ak.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ak'
+func (ak *ak) PluralsOrdinal() []locales.PluralRule {
+ return ak.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ak'
+func (ak *ak) PluralsRange() []locales.PluralRule {
+ return ak.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ak'
+func (ak *ak) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n >= 0 && n <= 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ak'
+func (ak *ak) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ak'
+func (ak *ak) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ak *ak) MonthAbbreviated(month time.Month) string {
+ return ak.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ak *ak) MonthsAbbreviated() []string {
+ return ak.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ak *ak) MonthNarrow(month time.Month) string {
+ return ak.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ak *ak) MonthsNarrow() []string {
+ return nil
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ak *ak) MonthWide(month time.Month) string {
+ return ak.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ak *ak) MonthsWide() []string {
+ return ak.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ak *ak) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ak.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ak *ak) WeekdaysAbbreviated() []string {
+ return ak.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ak *ak) WeekdayNarrow(weekday time.Weekday) string {
+ return ak.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ak *ak) WeekdaysNarrow() []string {
+ return ak.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ak *ak) WeekdayShort(weekday time.Weekday) string {
+ return ak.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ak *ak) WeekdaysShort() []string {
+ return ak.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ak *ak) WeekdayWide(weekday time.Weekday) string {
+ return ak.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ak *ak) WeekdaysWide() []string {
+ return ak.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ak *ak) Decimal() string {
+ return ak.decimal
+}
+
+// Group returns the group of number
+func (ak *ak) Group() string {
+ return ak.group
+}
+
+// Group returns the minus sign of number
+func (ak *ak) Minus() string {
+ return ak.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ak' and handles both Whole and Real numbers based on 'v'
+func (ak *ak) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ak' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ak *ak) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ak'
+func (ak *ak) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ak.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ak.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ak.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ak.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ak.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ak'
+// in accounting notation.
+func (ak *ak) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ak.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ak.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ak.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ak.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ak.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ak'
+func (ak *ak) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ak'
+func (ak *ak) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ak'
+func (ak *ak) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ak'
+func (ak *ak) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ak.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ak'
+func (ak *ak) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ak'
+func (ak *ak) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ak'
+func (ak *ak) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ak'
+func (ak *ak) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ak.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ak/ak_test.go b/vendor/github.com/go-playground/locales/ak/ak_test.go
new file mode 100644
index 000000000..4199279ed
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ak/ak_test.go
@@ -0,0 +1,1120 @@
+package ak
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ak"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ak_GH/ak_GH.go b/vendor/github.com/go-playground/locales/ak_GH/ak_GH.go
new file mode 100644
index 000000000..7631b8a4e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ak_GH/ak_GH.go
@@ -0,0 +1,578 @@
+package ak_GH
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ak_GH struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ak_GH' locale
+func New() locales.Translator {
+ return &ak_GH{
+ locale: "ak_GH",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ".",
+ group: ",",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "S-Ɔ", "K-Ɔ", "E-Ɔ", "E-O", "E-K", "O-A", "A-K", "D-Ɔ", "F-Ɛ", "Ɔ-A", "Ɔ-O", "M-Ɔ"},
+ monthsWide: []string{"", "Sanda-Ɔpɛpɔn", "Kwakwar-Ɔgyefuo", "Ebɔw-Ɔbenem", "Ebɔbira-Oforisuo", "Esusow Aketseaba-Kɔtɔnimba", "Obirade-Ayɛwohomumu", "Ayɛwoho-Kitawonsa", "Difuu-Ɔsandaa", "Fankwa-Ɛbɔ", "Ɔbɛsɛ-Ahinime", "Ɔberɛfɛw-Obubuo", "Mumu-Ɔpɛnimba"},
+ daysAbbreviated: []string{"Kwe", "Dwo", "Ben", "Wuk", "Yaw", "Fia", "Mem"},
+ daysNarrow: []string{"K", "D", "B", "W", "Y", "F", "M"},
+ daysWide: []string{"Kwesida", "Dwowda", "Benada", "Wukuda", "Yawda", "Fida", "Memeneda"},
+ periodsAbbreviated: []string{"AN", "EW"},
+ periodsWide: []string{"AN", "EW"},
+ erasAbbreviated: []string{"AK", "KE"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ansa Kristo", "Kristo Ekyiri"},
+ timezones: map[string]string{"ECT": "ECT", "WART": "WART", "VET": "VET", "ART": "ART", "GYT": "GYT", "UYT": "UYT", "HNPMX": "HNPMX", "AST": "AST", "MESZ": "MESZ", "LHDT": "LHDT", "HAT": "HAT", "CDT": "CDT", "WAT": "WAT", "BOT": "BOT", "ACST": "ACST", "ACDT": "ACDT", "TMST": "TMST", "OEZ": "OEZ", "WEZ": "WEZ", "NZDT": "NZDT", "EST": "EST", "ACWDT": "ACWDT", "WAST": "WAST", "HENOMX": "HENOMX", "ARST": "ARST", "GMT": "GMT", "ChST": "ChST", "CHADT": "CHADT", "HNCU": "HNCU", "AWST": "AWST", "HKT": "HKT", "GFT": "GFT", "OESZ": "OESZ", "HECU": "HECU", "PDT": "PDT", "ADT": "ADT", "WESZ": "WESZ", "WIB": "WIB", "MYT": "MYT", "IST": "IST", "SRT": "SRT", "TMT": "TMT", "NZST": "NZST", "WARST": "WARST", "HEPM": "HEPM", "CAT": "CAT", "EAT": "EAT", "COT": "COT", "UYST": "UYST", "HEPMX": "HEPMX", "ACWST": "ACWST", "HEEG": "HEEG", "HEOG": "HEOG", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "HNNOMX": "HNNOMX", "WIT": "WIT", "CST": "CST", "AKDT": "AKDT", "SGT": "SGT", "HNT": "HNT", "MDT": "MDT", "CLST": "CLST", "HAST": "HAST", "HADT": "HADT", "CHAST": "CHAST", "AKST": "AKST", "HNEG": "HNEG", "HNOG": "HNOG", "MST": "MST", "AEST": "AEST", "HNPM": "HNPM", "BT": "BT", "LHST": "LHST", "WITA": "WITA", "AWDT": "AWDT", "SAST": "SAST", "HKST": "HKST", "CLT": "CLT", "COST": "COST", "PST": "PST", "JST": "JST", "AEDT": "AEDT", "JDT": "JDT", "EDT": "EDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ak *ak_GH) Locale() string {
+ return ak.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ak_GH'
+func (ak *ak_GH) PluralsCardinal() []locales.PluralRule {
+ return ak.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ak_GH'
+func (ak *ak_GH) PluralsOrdinal() []locales.PluralRule {
+ return ak.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ak_GH'
+func (ak *ak_GH) PluralsRange() []locales.PluralRule {
+ return ak.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ak_GH'
+func (ak *ak_GH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n >= 0 && n <= 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ak_GH'
+func (ak *ak_GH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ak_GH'
+func (ak *ak_GH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ak *ak_GH) MonthAbbreviated(month time.Month) string {
+ return ak.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ak *ak_GH) MonthsAbbreviated() []string {
+ return ak.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ak *ak_GH) MonthNarrow(month time.Month) string {
+ return ak.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ak *ak_GH) MonthsNarrow() []string {
+ return nil
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ak *ak_GH) MonthWide(month time.Month) string {
+ return ak.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ak *ak_GH) MonthsWide() []string {
+ return ak.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ak *ak_GH) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ak.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ak *ak_GH) WeekdaysAbbreviated() []string {
+ return ak.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ak *ak_GH) WeekdayNarrow(weekday time.Weekday) string {
+ return ak.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ak *ak_GH) WeekdaysNarrow() []string {
+ return ak.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ak *ak_GH) WeekdayShort(weekday time.Weekday) string {
+ return ak.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ak *ak_GH) WeekdaysShort() []string {
+ return ak.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ak *ak_GH) WeekdayWide(weekday time.Weekday) string {
+ return ak.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ak *ak_GH) WeekdaysWide() []string {
+ return ak.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ak *ak_GH) Decimal() string {
+ return ak.decimal
+}
+
+// Group returns the group of number
+func (ak *ak_GH) Group() string {
+ return ak.group
+}
+
+// Group returns the minus sign of number
+func (ak *ak_GH) Minus() string {
+ return ak.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ak_GH' and handles both Whole and Real numbers based on 'v'
+func (ak *ak_GH) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ak_GH' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ak *ak_GH) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ak_GH'
+func (ak *ak_GH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ak.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ak.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ak.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ak.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ak.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ak_GH'
+// in accounting notation.
+func (ak *ak_GH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ak.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ak.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ak.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ak.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ak.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ak.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ak.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ak_GH'
+func (ak *ak_GH) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ak.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ak.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ak.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ak.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ak_GH/ak_GH_test.go b/vendor/github.com/go-playground/locales/ak_GH/ak_GH_test.go
new file mode 100644
index 000000000..515acbe84
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ak_GH/ak_GH_test.go
@@ -0,0 +1,1120 @@
+package ak_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ak_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/am/am.go b/vendor/github.com/go-playground/locales/am/am.go
new file mode 100644
index 000000000..8805924c6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/am/am.go
@@ -0,0 +1,658 @@
+package am
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type am struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'am' locale
+func New() locales.Translator {
+ return &am{
+ locale: "am",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "የቻይና ዩዋን", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ብር", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "ጃንዩ", "ፌብሩ", "ማርች", "ኤፕሪ", "ሜይ", "ጁን", "ጁላይ", "ኦገስ", "ሴፕቴ", "ኦክቶ", "ኖቬም", "ዲሴም"},
+ monthsNarrow: []string{"", "ጃ", "ፌ", "ማ", "ኤ", "ሜ", "ጁ", "ጁ", "ኦ", "ሴ", "ኦ", "ኖ", "ዲ"},
+ monthsWide: []string{"", "ጃንዩወሪ", "ፌብሩወሪ", "ማርች", "ኤፕሪል", "ሜይ", "ጁን", "ጁላይ", "ኦገስት", "ሴፕቴምበር", "ኦክቶበር", "ኖቬምበር", "ዲሴምበር"},
+ daysAbbreviated: []string{"እሑድ", "ሰኞ", "ማክሰ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ"},
+ daysNarrow: []string{"እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"},
+ daysShort: []string{"እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"},
+ daysWide: []string{"እሑድ", "ሰኞ", "ማክሰኞ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ"},
+ periodsAbbreviated: []string{"ጥዋት", "ከሰዓት"},
+ periodsNarrow: []string{"ጠ", "ከ"},
+ periodsWide: []string{"ጥዋት", "ከሰዓት"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"ዓ/ዓ", "ዓ/ም"},
+ erasWide: []string{"ዓመተ ዓለም", "ዓመተ ምሕረት"},
+ timezones: map[string]string{"SRT": "የሱሪናም ሰዓት", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "GYT": "የጉያና ሰዓት", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "HNNOMX": "ሰሜናዊ ምእራብ የሜክሲኮ መደበኛ ሰዓት አቆጣጠር", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "HEEG": "የምስራቅ ግሪንላንድ ክረምት ሰዓት", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "MST": "MST", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "HENOMX": "ሰሜናዊ ምእራብ የሜክሲኮ የቀን ሰዓት አቆጣጠር", "CHAST": "የቻታም መደበኛ ሰዓት", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "HEPMX": "የሜክሲኮ ፓሲፊክ የቀን ሰዓት አቆጣጠር", "ECT": "የኢኳዶር ሰዓት", "IST": "የህንድ መደበኛ ሰዓት", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "UYT": "የኡራጓይ መደበኛ ሰዓት", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "COST": "የኮሎምቢያ ክረምት ሰዓት", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "CLST": "የቺሊ ክረምት ሰዓት", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "HECU": "የኩባ የቀን ብርሃን ሰዓት", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት", "HNCU": "የኩባ መደበኛ ሰዓት", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "BT": "የቡታን ሰዓት", "JST": "የጃፓን መደበኛ ሰዓት", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "HNEG": "የምስራቅ ግሪንላንድ መደበኛ ሰዓት", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "UYST": "የኡራጓይ ክረምት ሰዓት", "HNPM": "ቅዱስ የፒዬር እና ሚኴሎን መደበኛ ሰዓት", "CLT": "የቺሊ መደበኛ ሰዓት", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት", "HEOG": "የምዕራብ ግሪንላንድ ክረምት ሰዓት", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "VET": "የቬኔዝዌላ ሰዓት", "HNPMX": "የሜክሲኮ ፓሲፊክ መደበኛ ሰዓት አቆጣጠር", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር", "∅∅∅": "የአማዞን የቀን ሰዓት አቆጣጠር", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "MDT": "MDT", "HEPM": "ቅዱስ የፒዬር እና ሚኴሎን የቀን ብርሃን ሰዓት", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "ChST": "የቻሞሮ መደበኛ ሰዓት", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "GFT": "የፈረንሳይ ጉያና ሰዓት", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "MYT": "የማሌይዢያ ሰዓት", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "ART": "የአርጀንቲና መደበኛ ሰዓት አቆጣጠር", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "BOT": "የቦሊቪያ ሰዓት", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር", "EAT": "የምስራቅ አፍሪካ ሰዓት", "HNOG": "የምዕራብ ግሪንላንድ መደበኛ ሰዓት", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (am *am) Locale() string {
+ return am.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'am'
+func (am *am) PluralsCardinal() []locales.PluralRule {
+ return am.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'am'
+func (am *am) PluralsOrdinal() []locales.PluralRule {
+ return am.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'am'
+func (am *am) PluralsRange() []locales.PluralRule {
+ return am.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'am'
+func (am *am) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'am'
+func (am *am) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'am'
+func (am *am) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := am.CardinalPluralRule(num1, v1)
+ end := am.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (am *am) MonthAbbreviated(month time.Month) string {
+ return am.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (am *am) MonthsAbbreviated() []string {
+ return am.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (am *am) MonthNarrow(month time.Month) string {
+ return am.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (am *am) MonthsNarrow() []string {
+ return am.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (am *am) MonthWide(month time.Month) string {
+ return am.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (am *am) MonthsWide() []string {
+ return am.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (am *am) WeekdayAbbreviated(weekday time.Weekday) string {
+ return am.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (am *am) WeekdaysAbbreviated() []string {
+ return am.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (am *am) WeekdayNarrow(weekday time.Weekday) string {
+ return am.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (am *am) WeekdaysNarrow() []string {
+ return am.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (am *am) WeekdayShort(weekday time.Weekday) string {
+ return am.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (am *am) WeekdaysShort() []string {
+ return am.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (am *am) WeekdayWide(weekday time.Weekday) string {
+ return am.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (am *am) WeekdaysWide() []string {
+ return am.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (am *am) Decimal() string {
+ return am.decimal
+}
+
+// Group returns the group of number
+func (am *am) Group() string {
+ return am.group
+}
+
+// Group returns the minus sign of number
+func (am *am) Minus() string {
+ return am.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'am' and handles both Whole and Real numbers based on 'v'
+func (am *am) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'am' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (am *am) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, am.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'am'
+func (am *am) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := am.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, am.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'am'
+// in accounting notation.
+func (am *am) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := am.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, am.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, am.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, am.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'am'
+func (am *am) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'am'
+func (am *am) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'am'
+func (am *am) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'am'
+func (am *am) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, am.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20, 0xe1, 0x8d, 0xa3}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'am'
+func (am *am) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'am'
+func (am *am) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'am'
+func (am *am) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'am'
+func (am *am) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := am.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/am/am_test.go b/vendor/github.com/go-playground/locales/am/am_test.go
new file mode 100644
index 000000000..a8c42769b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/am/am_test.go
@@ -0,0 +1,1120 @@
+package am
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "am"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/am_ET/am_ET.go b/vendor/github.com/go-playground/locales/am_ET/am_ET.go
new file mode 100644
index 000000000..1b86264e0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/am_ET/am_ET.go
@@ -0,0 +1,658 @@
+package am_ET
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type am_ET struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'am_ET' locale
+func New() locales.Translator {
+ return &am_ET{
+ locale: "am_ET",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "ጃንዩ", "ፌብሩ", "ማርች", "ኤፕሪ", "ሜይ", "ጁን", "ጁላይ", "ኦገስ", "ሴፕቴ", "ኦክቶ", "ኖቬም", "ዲሴም"},
+ monthsNarrow: []string{"", "ጃ", "ፌ", "ማ", "ኤ", "ሜ", "ጁ", "ጁ", "ኦ", "ሴ", "ኦ", "ኖ", "ዲ"},
+ monthsWide: []string{"", "ጃንዩወሪ", "ፌብሩወሪ", "ማርች", "ኤፕሪል", "ሜይ", "ጁን", "ጁላይ", "ኦገስት", "ሴፕቴምበር", "ኦክቶበር", "ኖቬምበር", "ዲሴምበር"},
+ daysAbbreviated: []string{"እሑድ", "ሰኞ", "ማክሰ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ"},
+ daysNarrow: []string{"እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"},
+ daysShort: []string{"እ", "ሰ", "ማ", "ረ", "ሐ", "ዓ", "ቅ"},
+ daysWide: []string{"እሑድ", "ሰኞ", "ማክሰኞ", "ረቡዕ", "ሐሙስ", "ዓርብ", "ቅዳሜ"},
+ periodsAbbreviated: []string{"ጥዋት", "ከሰዓት"},
+ periodsNarrow: []string{"ጠ", "ከ"},
+ periodsWide: []string{"ጥዋት", "ከሰዓት"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"ዓ/ዓ", "ዓ/ም"},
+ erasWide: []string{"ዓመተ ዓለም", "ዓመተ ምሕረት"},
+ timezones: map[string]string{"EAT": "የምስራቅ አፍሪካ ሰዓት", "HECU": "የኩባ የቀን ብርሃን ሰዓት", "AWDT": "የአውስትራሊያ ምስራቃዊ የቀን ሰዓት አቆጣጠር", "SGT": "የሲንጋፒር መደበኛ ሰዓት", "MEZ": "የመካከለኛው አውሮፓ መደበኛ ሰዓት", "IST": "የህንድ መደበኛ ሰዓት", "LHST": "የሎርድ ሆዌ መደበኛ የሰዓት አቆጣጠር", "WITA": "የመካከለኛው ኢንዶኔዢያ ሰዓት", "HAST": "የሃዋይ አሌኡት መደበኛ ሰዓት አቆጣጠር", "COST": "የኮሎምቢያ ክረምት ሰዓት", "HNPMX": "የሜክሲኮ ፓሲፊክ መደበኛ ሰዓት አቆጣጠር", "NZDT": "የኒው ዚላንድ የቀን ብርሃን ሰዓት", "MYT": "የማሌይዢያ ሰዓት", "HKST": "የሆንግ ኮንግ ክረምት ሰዓት", "WART": "የምዕራባዊ አርጀንቲና መደበኛ ሰዓት አቆጣጠር", "WARST": "የአርጀንቲና ምስራቃዊ በጋ ሰዓት አቆጣጠር", "ChST": "የቻሞሮ መደበኛ ሰዓት", "SAST": "የደቡብ አፍሪካ መደበኛ ሰዓት", "CHADT": "የቻታም የቀን ብርሃን ሰዓት", "ACST": "የአውስትራሊያ መካከለኛ መደበኛ የሰዓት አቆጣጠር", "HNNOMX": "ሰሜናዊ ምእራብ የሜክሲኮ መደበኛ ሰዓት አቆጣጠር", "WIT": "የምስራቃዊ ኢንዶኔዢያ ሰዓት", "UYST": "የኡራጓይ ክረምት ሰዓት", "WEZ": "የምዕራባዊ አውሮፓ መደበኛ ሰዓት", "BT": "የቡታን ሰዓት", "HEPM": "ቅዱስ የፒዬር እና ሚኴሎን የቀን ብርሃን ሰዓት", "ART": "የአርጀንቲና መደበኛ ሰዓት አቆጣጠር", "PDT": "የፓስፊክ የቀን ሰዓት አቆጣጠር", "MST": "የተራራ መደበኛ የሰዓት አቆጣጠር", "HNT": "የኒውፋውንድላንድ መደበኛ የሰዓት አቆጣጠር", "CLT": "የቺሊ መደበኛ ሰዓት", "OESZ": "የምስራቃዊ አውሮፓ ክረምት ሰዓት", "AWST": "የአውስትራሊያ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "WAT": "የምዕራብ አፍሪካ መደበኛ ሰዓት", "WESZ": "የምዕራባዊ አውሮፓ ክረምት ሰዓት", "GYT": "የጉያና ሰዓት", "JDT": "የጃፓን የቀን ብርሃን ሰዓት", "AKDT": "የአላስካ የቀን ሰዓት አቆጣጠር", "EST": "የምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "HEOG": "የምዕራብ ግሪንላንድ ክረምት ሰዓት", "MESZ": "የመካከለኛው አውሮፓ ክረምት ሰዓት", "LHDT": "የሎርድ ሆዌ የቀን ሰዓት አቆጣጠር", "VET": "የቬኔዝዌላ ሰዓት", "CHAST": "የቻታም መደበኛ ሰዓት", "AKST": "የአላስካ መደበኛ የሰዓት አቆጣጠር", "HENOMX": "ሰሜናዊ ምእራብ የሜክሲኮ የቀን ሰዓት አቆጣጠር", "COT": "የኮሎምቢያ መደበኛ ሰዓት", "GMT": "ግሪንዊች ማዕከላዊ ሰዓት", "PST": "የፓስፊክ መደበኛ ሰዓት አቆጣጠር", "AST": "የአትላንቲክ መደበኛ የሰዓት አቆጣጠር", "AEDT": "የአውስትራሊያ ምዕራባዊ የቀን ሰዓት አቆጣጠር", "HNEG": "የምስራቅ ግሪንላንድ መደበኛ ሰዓት", "HADT": "የሃዋይ አሌኡት የቀን ሰዓት አቆጣጠር", "HNCU": "የኩባ መደበኛ ሰዓት", "JST": "የጃፓን መደበኛ ሰዓት", "NZST": "የኒው ዚላንድ መደበኛ ሰዓት", "BOT": "የቦሊቪያ ሰዓት", "EDT": "የምዕራባዊ የቀን ሰዓት አቆጣጠር", "ACDT": "የአውስትራሊያ መካከለኛ የቀን ሰዓት አቆጣጠር", "CAT": "የመካከለኛው አፍሪካ ሰዓት", "ADT": "የአትላንቲክ የቀን ሰዓት አቆጣጠር", "ACWST": "የአውስትራሊያ መካከለኛ ምስራቃዊ መደበኛ ሰዓት አቆጣጠር", "HNPM": "ቅዱስ የፒዬር እና ሚኴሎን መደበኛ ሰዓት", "CLST": "የቺሊ ክረምት ሰዓት", "∅∅∅": "የብራዚላ የበጋ ሰዓት አቆጣጠር", "CST": "የመካከለኛ መደበኛ ሰዓት አቆጣጠር", "AEST": "የአውስትራሊያ ምዕራባዊ መደበኛ የሰዓት አቆጣጠር", "ACWDT": "የአውስትራሊያ መካከለኛው ምስራቅ የቀን ሰዓት አቆጣጠር", "HNOG": "የምዕራብ ግሪንላንድ መደበኛ ሰዓት", "HKT": "የሆንግ ኮንግ መደበኛ ሰዓት", "UYT": "የኡራጓይ መደበኛ ሰዓት", "MDT": "የተራራ የቀንሰዓት አቆጣጠር", "WIB": "የምዕራባዊ ኢንዶኔዢያ ሰዓት", "GFT": "የፈረንሳይ ጉያና ሰዓት", "HAT": "የኒውፋውንድላንድ የቀን የሰዓት አቆጣጠር", "TMST": "የቱርክመኒስታን ክረምት ሰዓት", "OEZ": "የምስራቃዊ አውሮፓ መደበኛ ሰዓት", "ARST": "የአርጀንቲና የበጋ ሰዓት አቆጣጠር", "CDT": "የመካከለኛ የቀን ሰዓት አቆጣጠር", "HEPMX": "የሜክሲኮ ፓሲፊክ የቀን ሰዓት አቆጣጠር", "WAST": "የምዕራብ አፍሪካ ክረምት ሰዓት", "ECT": "የኢኳዶር ሰዓት", "HEEG": "የምስራቅ ግሪንላንድ ክረምት ሰዓት", "SRT": "የሱሪናም ሰዓት", "TMT": "የቱርክመኒስታን መደበኛ ሰዓት"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (am *am_ET) Locale() string {
+ return am.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'am_ET'
+func (am *am_ET) PluralsCardinal() []locales.PluralRule {
+ return am.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'am_ET'
+func (am *am_ET) PluralsOrdinal() []locales.PluralRule {
+ return am.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'am_ET'
+func (am *am_ET) PluralsRange() []locales.PluralRule {
+ return am.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'am_ET'
+func (am *am_ET) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'am_ET'
+func (am *am_ET) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'am_ET'
+func (am *am_ET) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := am.CardinalPluralRule(num1, v1)
+ end := am.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (am *am_ET) MonthAbbreviated(month time.Month) string {
+ return am.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (am *am_ET) MonthsAbbreviated() []string {
+ return am.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (am *am_ET) MonthNarrow(month time.Month) string {
+ return am.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (am *am_ET) MonthsNarrow() []string {
+ return am.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (am *am_ET) MonthWide(month time.Month) string {
+ return am.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (am *am_ET) MonthsWide() []string {
+ return am.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (am *am_ET) WeekdayAbbreviated(weekday time.Weekday) string {
+ return am.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (am *am_ET) WeekdaysAbbreviated() []string {
+ return am.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (am *am_ET) WeekdayNarrow(weekday time.Weekday) string {
+ return am.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (am *am_ET) WeekdaysNarrow() []string {
+ return am.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (am *am_ET) WeekdayShort(weekday time.Weekday) string {
+ return am.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (am *am_ET) WeekdaysShort() []string {
+ return am.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (am *am_ET) WeekdayWide(weekday time.Weekday) string {
+ return am.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (am *am_ET) WeekdaysWide() []string {
+ return am.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (am *am_ET) Decimal() string {
+ return am.decimal
+}
+
+// Group returns the group of number
+func (am *am_ET) Group() string {
+ return am.group
+}
+
+// Group returns the minus sign of number
+func (am *am_ET) Minus() string {
+ return am.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'am_ET' and handles both Whole and Real numbers based on 'v'
+func (am *am_ET) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'am_ET' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (am *am_ET) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, am.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'am_ET'
+func (am *am_ET) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := am.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, am.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, am.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'am_ET'
+// in accounting notation.
+func (am *am_ET) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := am.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, am.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, am.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, am.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, am.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, am.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'am_ET'
+func (am *am_ET) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'am_ET'
+func (am *am_ET) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'am_ET'
+func (am *am_ET) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'am_ET'
+func (am *am_ET) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, am.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20, 0xe1, 0x8d, 0xa3}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, am.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'am_ET'
+func (am *am_ET) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'am_ET'
+func (am *am_ET) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'am_ET'
+func (am *am_ET) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'am_ET'
+func (am *am_ET) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, am.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, am.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, am.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := am.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/am_ET/am_ET_test.go b/vendor/github.com/go-playground/locales/am_ET/am_ET_test.go
new file mode 100644
index 000000000..1f5f41180
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/am_ET/am_ET_test.go
@@ -0,0 +1,1120 @@
+package am_ET
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "am_ET"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar/ar.go b/vendor/github.com/go-playground/locales/ar/ar.go
new file mode 100644
index 000000000..badab6e4a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar/ar.go
@@ -0,0 +1,727 @@
+package ar
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar' locale
+func New() locales.Translator {
+ return &ar{
+ locale: "ar",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "د.إ.\u200f", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "د.ب.\u200f", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "د.ج.\u200f", "ECS", "ECV", "EEK", "ج.م.\u200f", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "د.ع.\u200f", "ر.إ.", "ISJ", "ISK", "ITL", "JMD", "د.أ.\u200f", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "د.ك.\u200f", "KYD", "KZT", "LAK", "ل.ل.\u200f", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "د.ل.\u200f", "د.م.\u200f", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "أ.م.\u200f", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "ر.ع.\u200f", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "ر.ق.\u200f", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "ر.س.\u200f", "SBD", "SCR", "د.س.\u200f", "ج.س.", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "ل.س.\u200f", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "د.ت.\u200f", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "***", "YDD", "ر.ي.\u200f", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"SAST": "توقيت جنوب أفريقيا", "ACDT": "توقيت وسط أستراليا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "TMT": "توقيت تركمانستان الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "ACST": "توقيت وسط أستراليا الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "HECU": "توقيت كوبا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "GMT": "توقيت غرينتش", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "NZST": "توقيت نيوزيلندا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "IST": "توقيت الهند", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "GYT": "توقيت غيانا", "UYST": "توقيت أوروغواي الصيفي", "∅∅∅": "∅∅∅", "SGT": "توقيت سنغافورة", "HEOG": "توقيت غرب غرينلاند الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "WIB": "توقيت غرب إندونيسيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WIT": "توقيت شرق إندونيسيا", "CHADT": "توقيت تشاتام الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "TMST": "توقيت تركمانستان الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "VET": "توقيت فنزويلا", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "ART": "توقيت الأرجنتين الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "JST": "توقيت اليابان الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WITA": "توقيت وسط إندونيسيا", "COT": "توقيت كولومبيا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HAT": "توقيت نيوفاوندلاند الصيفي", "UYT": "توقيت أوروغواي الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "AKDT": "توقيت ألاسكا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "WART": "توقيت غرب الأرجنتين الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "BT": "توقيت بوتان", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CAT": "توقيت وسط أفريقيا", "EAT": "توقيت شرق أفريقيا", "CLT": "توقيت شيلي الرسمي", "HNCU": "توقيت كوبا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ECT": "توقيت الإكوادور", "HNEG": "توقيت شرق غرينلاند الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "ChST": "توقيت تشامورو", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WESZ": "توقيت غرب أوروبا الصيفي", "JDT": "توقيت اليابان الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar'
+func (ar *ar) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar'
+func (ar *ar) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar'
+func (ar *ar) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar'
+func (ar *ar) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar'
+func (ar *ar) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar'
+func (ar *ar) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar' and handles both Whole and Real numbers based on 'v'
+func (ar *ar) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar'
+func (ar *ar) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar'
+// in accounting notation.
+func (ar *ar) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar'
+func (ar *ar) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar'
+func (ar *ar) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar'
+func (ar *ar) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar'
+func (ar *ar) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar'
+func (ar *ar) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar'
+func (ar *ar) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar'
+func (ar *ar) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar'
+func (ar *ar) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar/ar_test.go b/vendor/github.com/go-playground/locales/ar/ar_test.go
new file mode 100644
index 000000000..b9d28aca8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar/ar_test.go
@@ -0,0 +1,1120 @@
+package ar
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_001/ar_001.go b/vendor/github.com/go-playground/locales/ar_001/ar_001.go
new file mode 100644
index 000000000..bac76e823
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_001/ar_001.go
@@ -0,0 +1,727 @@
+package ar_001
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_001 struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_001' locale
+func New() locales.Translator {
+ return &ar_001{
+ locale: "ar_001",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"SRT": "توقيت سورينام", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "AWST": "توقيت غرب أستراليا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "IST": "توقيت الهند", "ART": "توقيت الأرجنتين الرسمي", "GYT": "توقيت غيانا", "WART": "توقيت غرب الأرجنتين الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "MYT": "توقيت ماليزيا", "HNOG": "توقيت غرب غرينلاند الرسمي", "COST": "توقيت كولومبيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "WITA": "توقيت وسط إندونيسيا", "EAT": "توقيت شرق أفريقيا", "HECU": "توقيت كوبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "ChST": "توقيت تشامورو", "AST": "التوقيت الرسمي الأطلسي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "COT": "توقيت كولومبيا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "CHADT": "توقيت تشاتام الصيفي", "SGT": "توقيت سنغافورة", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "UYST": "توقيت أوروغواي الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "TMST": "توقيت تركمانستان الصيفي", "CLST": "توقيت شيلي الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "ECT": "توقيت الإكوادور", "HKT": "توقيت هونغ كونغ الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "VET": "توقيت فنزويلا", "CAT": "توقيت وسط أفريقيا", "∅∅∅": "توقيت الأمازون الصيفي", "UYT": "توقيت أوروغواي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HNCU": "توقيت كوبا الرسمي", "SAST": "توقيت جنوب أفريقيا", "JST": "توقيت اليابان الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WESZ": "توقيت غرب أوروبا الصيفي", "GFT": "توقيت غايانا الفرنسية", "HEOG": "توقيت غرب غرينلاند الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "LHDT": "التوقيت الصيفي للورد هاو", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "CHAST": "توقيت تشاتام الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "BT": "توقيت بوتان", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CLT": "توقيت شيلي الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "BOT": "توقيت بوليفيا", "ACDT": "توقيت وسط أستراليا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WIT": "توقيت شرق إندونيسيا", "WEZ": "توقيت غرب أوروبا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_001) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_001'
+func (ar *ar_001) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_001'
+func (ar *ar_001) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_001'
+func (ar *ar_001) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_001'
+func (ar *ar_001) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_001'
+func (ar *ar_001) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_001'
+func (ar *ar_001) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_001) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_001) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_001) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_001) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_001) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_001) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_001) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_001) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_001) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_001) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_001) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_001) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_001) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_001) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_001) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_001) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_001) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_001' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_001) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_001' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_001) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_001'
+func (ar *ar_001) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_001'
+// in accounting notation.
+func (ar *ar_001) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_001'
+func (ar *ar_001) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_001'
+func (ar *ar_001) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_001'
+func (ar *ar_001) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_001'
+func (ar *ar_001) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_001'
+func (ar *ar_001) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_001'
+func (ar *ar_001) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_001'
+func (ar *ar_001) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_001'
+func (ar *ar_001) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_001/ar_001_test.go b/vendor/github.com/go-playground/locales/ar_001/ar_001_test.go
new file mode 100644
index 000000000..cdd4cb343
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_001/ar_001_test.go
@@ -0,0 +1,1120 @@
+package ar_001
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_001"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_AE/ar_AE.go b/vendor/github.com/go-playground/locales/ar_AE/ar_AE.go
new file mode 100644
index 000000000..09f8d3cc3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_AE/ar_AE.go
@@ -0,0 +1,727 @@
+package ar_AE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_AE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_AE' locale
+func New() locales.Translator {
+ return &ar_AE{
+ locale: "ar_AE",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "$", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"HNT": "توقيت نيوفاوندلاند الرسمي", "UYT": "توقيت أوروغواي الرسمي", "UYST": "توقيت أوروغواي الصيفي", "ChST": "توقيت تشامورو", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "JST": "توقيت اليابان الرسمي", "EAT": "توقيت شرق أفريقيا", "GYT": "توقيت غيانا", "ECT": "توقيت الإكوادور", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "CHADT": "توقيت تشاتام الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "AKST": "التوقيت الرسمي لألاسكا", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "HADT": "توقيت هاواي ألوتيان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "HECU": "توقيت كوبا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "BT": "توقيت بوتان", "NZDT": "توقيت نيوزيلندا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "AST": "التوقيت الرسمي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "AKDT": "توقيت ألاسكا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "IST": "توقيت الهند", "CLT": "توقيت شيلي الرسمي", "TMT": "توقيت تركمانستان الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HEOG": "توقيت غرب غرينلاند الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "SGT": "توقيت سنغافورة", "ACST": "توقيت وسط أستراليا الرسمي", "CAT": "توقيت وسط أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "WIT": "توقيت شرق إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "CHAST": "توقيت تشاتام الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "GMT": "توقيت غرينتش", "HNCU": "توقيت كوبا الرسمي", "BOT": "توقيت بوليفيا", "HNOG": "توقيت غرب غرينلاند الرسمي", "VET": "توقيت فنزويلا", "COT": "توقيت كولومبيا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "MYT": "توقيت ماليزيا", "GFT": "توقيت غايانا الفرنسية", "MEZ": "توقيت وسط أوروبا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HAST": "توقيت هاواي ألوتيان الرسمي", "ART": "توقيت الأرجنتين الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "AEDT": "توقيت شرق أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_AE) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_AE'
+func (ar *ar_AE) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_AE'
+func (ar *ar_AE) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_AE'
+func (ar *ar_AE) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_AE'
+func (ar *ar_AE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_AE'
+func (ar *ar_AE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_AE'
+func (ar *ar_AE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_AE) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_AE) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_AE) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_AE) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_AE) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_AE) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_AE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_AE) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_AE) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_AE) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_AE) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_AE) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_AE) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_AE) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_AE) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_AE) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_AE) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_AE' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_AE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_AE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_AE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_AE'
+func (ar *ar_AE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_AE'
+// in accounting notation.
+func (ar *ar_AE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_AE'
+func (ar *ar_AE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_AE/ar_AE_test.go b/vendor/github.com/go-playground/locales/ar_AE/ar_AE_test.go
new file mode 100644
index 000000000..420d048a1
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_AE/ar_AE_test.go
@@ -0,0 +1,1120 @@
+package ar_AE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_AE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_BH/ar_BH.go b/vendor/github.com/go-playground/locales/ar_BH/ar_BH.go
new file mode 100644
index 000000000..dfe80d433
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_BH/ar_BH.go
@@ -0,0 +1,727 @@
+package ar_BH
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_BH struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_BH' locale
+func New() locales.Translator {
+ return &ar_BH{
+ locale: "ar_BH",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ChST": "توقيت تشامورو", "MYT": "توقيت ماليزيا", "HKST": "توقيت هونغ كونغ الصيفي", "IST": "توقيت الهند", "SRT": "توقيت سورينام", "SAST": "توقيت جنوب أفريقيا", "HNOG": "توقيت غرب غرينلاند الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "SGT": "توقيت سنغافورة", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "UYT": "توقيت أوروغواي الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNEG": "توقيت شرق غرينلاند الرسمي", "TMST": "توقيت تركمانستان الصيفي", "GFT": "توقيت غايانا الفرنسية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "HNCU": "توقيت كوبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "JDT": "توقيت اليابان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "BOT": "توقيت بوليفيا", "∅∅∅": "توقيت الأمازون الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "GMT": "توقيت غرينتش", "GYT": "توقيت غيانا", "BT": "توقيت بوتان", "EAT": "توقيت شرق أفريقيا", "CLST": "توقيت شيلي الصيفي", "TMT": "توقيت تركمانستان الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "CAT": "توقيت وسط أفريقيا", "HECU": "توقيت كوبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "COST": "توقيت كولومبيا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "VET": "توقيت فنزويلا", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CHAST": "توقيت تشاتام الرسمي", "JST": "توقيت اليابان الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "CLT": "توقيت شيلي الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "NZDT": "توقيت نيوزيلندا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "OESZ": "توقيت شرق أوروبا الصيفي", "COT": "توقيت كولومبيا الرسمي", "UYST": "توقيت أوروغواي الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "ACST": "توقيت وسط أستراليا الرسمي", "ECT": "توقيت الإكوادور", "LHDT": "التوقيت الصيفي للورد هاو", "WARST": "توقيت غرب الأرجنتين الصيفي", "WIT": "توقيت شرق إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_BH) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_BH'
+func (ar *ar_BH) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_BH'
+func (ar *ar_BH) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_BH'
+func (ar *ar_BH) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_BH'
+func (ar *ar_BH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_BH'
+func (ar *ar_BH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_BH'
+func (ar *ar_BH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_BH) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_BH) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_BH) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_BH) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_BH) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_BH) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_BH) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_BH) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_BH) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_BH) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_BH) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_BH) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_BH) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_BH) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_BH) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_BH) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_BH) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_BH' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_BH) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_BH' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_BH) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_BH'
+func (ar *ar_BH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_BH'
+// in accounting notation.
+func (ar *ar_BH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_BH'
+func (ar *ar_BH) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_BH/ar_BH_test.go b/vendor/github.com/go-playground/locales/ar_BH/ar_BH_test.go
new file mode 100644
index 000000000..0a9075510
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_BH/ar_BH_test.go
@@ -0,0 +1,1120 @@
+package ar_BH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_BH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ.go b/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ.go
new file mode 100644
index 000000000..5b322a4ef
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ.go
@@ -0,0 +1,727 @@
+package ar_DJ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_DJ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_DJ' locale
+func New() locales.Translator {
+ return &ar_DJ{
+ locale: "ar_DJ",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "Fdj", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HEOG": "توقيت غرب غرينلاند الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "SRT": "توقيت سورينام", "COST": "توقيت كولومبيا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MDT": "MDT", "ChST": "توقيت تشامورو", "SAST": "توقيت جنوب أفريقيا", "BOT": "توقيت بوليفيا", "IST": "توقيت الهند", "WITA": "توقيت وسط إندونيسيا", "VET": "توقيت فنزويلا", "PST": "توقيت المحيط الهادي الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "EAT": "توقيت شرق أفريقيا", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "BT": "توقيت بوتان", "CLT": "توقيت شيلي الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "JST": "توقيت اليابان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "MYT": "توقيت ماليزيا", "HNEG": "توقيت شرق غرينلاند الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "UYST": "توقيت أوروغواي الصيفي", "HNCU": "توقيت كوبا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "TMST": "توقيت تركمانستان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "NZDT": "توقيت نيوزيلندا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "UYT": "توقيت أوروغواي الرسمي", "HECU": "توقيت كوبا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "CHAST": "توقيت تشاتام الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "CLST": "توقيت شيلي الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "WART": "توقيت غرب الأرجنتين الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "∅∅∅": "∅∅∅", "JDT": "توقيت اليابان الصيفي", "ECT": "توقيت الإكوادور", "LHST": "توقيت لورد هاو الرسمي", "CHADT": "توقيت تشاتام الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "AST": "التوقيت الرسمي الأطلسي", "SGT": "توقيت سنغافورة", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "MST": "MST", "GMT": "توقيت غرينتش", "GYT": "توقيت غيانا", "AWDT": "توقيت غرب أستراليا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "TMT": "توقيت تركمانستان الرسمي", "CAT": "توقيت وسط أفريقيا", "AEDT": "توقيت شرق أستراليا الصيفي", "WIB": "توقيت غرب إندونيسيا", "COT": "توقيت كولومبيا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_DJ) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_DJ'
+func (ar *ar_DJ) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_DJ'
+func (ar *ar_DJ) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_DJ'
+func (ar *ar_DJ) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_DJ'
+func (ar *ar_DJ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_DJ'
+func (ar *ar_DJ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_DJ'
+func (ar *ar_DJ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_DJ) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_DJ) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_DJ) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_DJ) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_DJ) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_DJ) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_DJ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_DJ) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_DJ) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_DJ) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_DJ) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_DJ) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_DJ) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_DJ) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_DJ) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_DJ) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_DJ) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_DJ' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_DJ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_DJ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_DJ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_DJ'
+func (ar *ar_DJ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_DJ'
+// in accounting notation.
+func (ar *ar_DJ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_DJ'
+func (ar *ar_DJ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ_test.go b/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ_test.go
new file mode 100644
index 000000000..7a0652960
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_DJ/ar_DJ_test.go
@@ -0,0 +1,1120 @@
+package ar_DJ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_DJ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ.go b/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ.go
new file mode 100644
index 000000000..5ceed5e1b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ.go
@@ -0,0 +1,713 @@
+package ar_DZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_DZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_DZ' locale
+func New() locales.Translator {
+ return &ar_DZ{
+ locale: "ar_DZ",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ج", "ف", "م", "أ", "م", "ج", "ج", "أ", "س", "أ", "ن", "د"},
+ monthsWide: []string{"", "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HEEG": "توقيت شرق غرينلاند الصيفي", "CHADT": "توقيت تشاتام الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "MDT": "MDT", "WESZ": "توقيت غرب أوروبا الصيفي", "BOT": "توقيت بوليفيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "TMT": "توقيت تركمانستان الرسمي", "UYT": "توقيت أوروغواي الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "IST": "توقيت الهند", "VET": "توقيت فنزويلا", "CAT": "توقيت وسط أفريقيا", "MYT": "توقيت ماليزيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "GMT": "توقيت غرينتش", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WIT": "توقيت شرق إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "MST": "MST", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "WITA": "توقيت وسط إندونيسيا", "ChST": "توقيت تشامورو", "AST": "التوقيت الرسمي الأطلسي", "ARST": "توقيت الأرجنتين الصيفي", "SAST": "توقيت جنوب أفريقيا", "NZST": "توقيت نيوزيلندا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ACST": "توقيت وسط أستراليا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "COT": "توقيت كولومبيا الرسمي", "HECU": "توقيت كوبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "∅∅∅": "توقيت أزورس الصيفي", "LHST": "توقيت لورد هاو الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "ECT": "توقيت الإكوادور", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "EAT": "توقيت شرق أفريقيا", "UYST": "توقيت أوروغواي الصيفي", "GYT": "توقيت غيانا", "HNCU": "توقيت كوبا الرسمي", "JST": "توقيت اليابان الرسمي", "JDT": "توقيت اليابان الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "CLT": "توقيت شيلي الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "SRT": "توقيت سورينام", "CLST": "توقيت شيلي الصيفي", "TMST": "توقيت تركمانستان الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WIB": "توقيت غرب إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "SGT": "توقيت سنغافورة", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "OEZ": "توقيت شرق أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "BT": "توقيت بوتان", "GFT": "توقيت غايانا الفرنسية", "AKDT": "توقيت ألاسكا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_DZ) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_DZ'
+func (ar *ar_DZ) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_DZ'
+func (ar *ar_DZ) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_DZ'
+func (ar *ar_DZ) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_DZ'
+func (ar *ar_DZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_DZ'
+func (ar *ar_DZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_DZ'
+func (ar *ar_DZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_DZ) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_DZ) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_DZ) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_DZ) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_DZ) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_DZ) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_DZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_DZ) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_DZ) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_DZ) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_DZ) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_DZ) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_DZ) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_DZ) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_DZ) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_DZ) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_DZ) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_DZ' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_DZ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_DZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_DZ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_DZ'
+func (ar *ar_DZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_DZ'
+// in accounting notation.
+func (ar *ar_DZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_DZ'
+func (ar *ar_DZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ_test.go b/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ_test.go
new file mode 100644
index 000000000..a14b6ce04
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_DZ/ar_DZ_test.go
@@ -0,0 +1,1120 @@
+package ar_DZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_DZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_EG/ar_EG.go b/vendor/github.com/go-playground/locales/ar_EG/ar_EG.go
new file mode 100644
index 000000000..a6ef2c277
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_EG/ar_EG.go
@@ -0,0 +1,727 @@
+package ar_EG
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_EG struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_EG' locale
+func New() locales.Translator {
+ return &ar_EG{
+ locale: "ar_EG",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"WART": "توقيت غرب الأرجنتين الرسمي", "CLT": "توقيت شيلي الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HKST": "توقيت هونغ كونغ الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CLST": "توقيت شيلي الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "SAST": "توقيت جنوب أفريقيا", "ECT": "توقيت الإكوادور", "HEOG": "توقيت غرب غرينلاند الصيفي", "ChST": "توقيت تشامورو", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "BOT": "توقيت بوليفيا", "JST": "توقيت اليابان الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "HNOG": "توقيت غرب غرينلاند الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "SRT": "توقيت سورينام", "AEST": "توقيت شرق أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "WIB": "توقيت غرب إندونيسيا", "COST": "توقيت كولومبيا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "LHST": "توقيت لورد هاو الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WITA": "توقيت وسط إندونيسيا", "CAT": "توقيت وسط أفريقيا", "ART": "توقيت الأرجنتين الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "GYT": "توقيت غيانا", "AWDT": "توقيت غرب أستراليا الصيفي", "BT": "توقيت بوتان", "MEZ": "توقيت وسط أوروبا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "EAT": "توقيت شرق أفريقيا", "NZDT": "توقيت نيوزيلندا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "UYT": "توقيت أوروغواي الرسمي", "UYST": "توقيت أوروغواي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "ARST": "توقيت الأرجنتين الصيفي", "MYT": "توقيت ماليزيا", "LHDT": "التوقيت الصيفي للورد هاو", "VET": "توقيت فنزويلا", "TMST": "توقيت تركمانستان الصيفي", "HECU": "توقيت كوبا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "COT": "توقيت كولومبيا الرسمي", "SGT": "توقيت سنغافورة", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "IST": "توقيت الهند", "WIT": "توقيت شرق إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "GMT": "توقيت غرينتش", "CHAST": "توقيت تشاتام الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AKDT": "توقيت ألاسكا الصيفي", "HNCU": "توقيت كوبا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_EG) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_EG'
+func (ar *ar_EG) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_EG'
+func (ar *ar_EG) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_EG'
+func (ar *ar_EG) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_EG'
+func (ar *ar_EG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_EG'
+func (ar *ar_EG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_EG'
+func (ar *ar_EG) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_EG) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_EG) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_EG) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_EG) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_EG) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_EG) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_EG) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_EG) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_EG) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_EG) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_EG) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_EG) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_EG) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_EG) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_EG) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_EG) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_EG) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_EG' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_EG) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_EG' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_EG) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_EG'
+func (ar *ar_EG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_EG'
+// in accounting notation.
+func (ar *ar_EG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_EG'
+func (ar *ar_EG) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_EG/ar_EG_test.go b/vendor/github.com/go-playground/locales/ar_EG/ar_EG_test.go
new file mode 100644
index 000000000..9bc3a93d0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_EG/ar_EG_test.go
@@ -0,0 +1,1120 @@
+package ar_EG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_EG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_EH/ar_EH.go b/vendor/github.com/go-playground/locales/ar_EH/ar_EH.go
new file mode 100644
index 000000000..2b826df78
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_EH/ar_EH.go
@@ -0,0 +1,727 @@
+package ar_EH
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_EH struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_EH' locale
+func New() locales.Translator {
+ return &ar_EH{
+ locale: "ar_EH",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HADT": "توقيت هاواي ألوتيان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "CHADT": "توقيت تشاتام الصيفي", "JST": "توقيت اليابان الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت الأمازون الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "HNEG": "توقيت شرق غرينلاند الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "CLST": "توقيت شيلي الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CAT": "توقيت وسط أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "AST": "التوقيت الرسمي الأطلسي", "BT": "توقيت بوتان", "MESZ": "توقيت وسط أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "WITA": "توقيت وسط إندونيسيا", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "GYT": "توقيت غيانا", "HECU": "توقيت كوبا الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "ADT": "التوقيت الصيفي الأطلسي", "AKST": "التوقيت الرسمي لألاسكا", "HKT": "توقيت هونغ كونغ الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "TMT": "توقيت تركمانستان الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "SAST": "توقيت جنوب أفريقيا", "ECT": "توقيت الإكوادور", "WARST": "توقيت غرب الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "VET": "توقيت فنزويلا", "ART": "توقيت الأرجنتين الرسمي", "GMT": "توقيت غرينتش", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "IST": "توقيت الهند", "CLT": "توقيت شيلي الرسمي", "WIT": "توقيت شرق إندونيسيا", "MYT": "توقيت ماليزيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "PST": "توقيت المحيط الهادي الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "BOT": "توقيت بوليفيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "ChST": "توقيت تشامورو", "HNCU": "توقيت كوبا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "SRT": "توقيت سورينام", "COT": "توقيت كولومبيا الرسمي", "UYST": "توقيت أوروغواي الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "GFT": "توقيت غايانا الفرنسية", "HNT": "توقيت نيوفاوندلاند الرسمي", "UYT": "توقيت أوروغواي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "EAT": "توقيت شرق أفريقيا"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_EH) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_EH'
+func (ar *ar_EH) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_EH'
+func (ar *ar_EH) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_EH'
+func (ar *ar_EH) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_EH'
+func (ar *ar_EH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_EH'
+func (ar *ar_EH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_EH'
+func (ar *ar_EH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_EH) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_EH) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_EH) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_EH) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_EH) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_EH) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_EH) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_EH) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_EH) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_EH) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_EH) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_EH) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_EH) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_EH) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_EH) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_EH) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_EH) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_EH' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_EH) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_EH' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_EH) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_EH'
+func (ar *ar_EH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_EH'
+// in accounting notation.
+func (ar *ar_EH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_EH'
+func (ar *ar_EH) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_EH/ar_EH_test.go b/vendor/github.com/go-playground/locales/ar_EH/ar_EH_test.go
new file mode 100644
index 000000000..db7c521f0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_EH/ar_EH_test.go
@@ -0,0 +1,1120 @@
+package ar_EH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_EH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_ER/ar_ER.go b/vendor/github.com/go-playground/locales/ar_ER/ar_ER.go
new file mode 100644
index 000000000..15a6c0ae3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_ER/ar_ER.go
@@ -0,0 +1,727 @@
+package ar_ER
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_ER struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_ER' locale
+func New() locales.Translator {
+ return &ar_ER{
+ locale: "ar_ER",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "Nfk", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"WAT": "توقيت غرب أفريقيا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "SRT": "توقيت سورينام", "CHADT": "توقيت تشاتام الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "HNEG": "توقيت شرق غرينلاند الرسمي", "VET": "توقيت فنزويلا", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "WIT": "توقيت شرق إندونيسيا", "COST": "توقيت كولومبيا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "GYT": "توقيت غيانا", "ChST": "توقيت تشامورو", "SAST": "توقيت جنوب أفريقيا", "HEEG": "توقيت شرق غرينلاند الصيفي", "CLST": "توقيت شيلي الصيفي", "TMT": "توقيت تركمانستان الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "HEOG": "توقيت غرب غرينلاند الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "WITA": "توقيت وسط إندونيسيا", "SGT": "توقيت سنغافورة", "ECT": "توقيت الإكوادور", "UYT": "توقيت أوروغواي الرسمي", "HECU": "توقيت كوبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "GFT": "توقيت غايانا الفرنسية", "JDT": "توقيت اليابان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "MDT": "MDT", "COT": "توقيت كولومبيا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "UYST": "توقيت أوروغواي الصيفي", "GMT": "توقيت غرينتش", "CHAST": "توقيت تشاتام الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CLT": "توقيت شيلي الرسمي", "CAT": "توقيت وسط أفريقيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "MYT": "توقيت ماليزيا", "BOT": "توقيت بوليفيا", "BT": "توقيت بوتان", "HKT": "توقيت هونغ كونغ الرسمي", "AST": "التوقيت الرسمي الأطلسي", "WESZ": "توقيت غرب أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "TMST": "توقيت تركمانستان الصيفي", "HNCU": "توقيت كوبا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "JST": "توقيت اليابان الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "OESZ": "توقيت شرق أوروبا الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "MST": "MST", "PST": "توقيت المحيط الهادي الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "WIB": "توقيت غرب إندونيسيا", "AKDT": "توقيت ألاسكا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ART": "توقيت الأرجنتين الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_ER) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_ER'
+func (ar *ar_ER) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_ER'
+func (ar *ar_ER) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_ER'
+func (ar *ar_ER) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_ER'
+func (ar *ar_ER) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_ER'
+func (ar *ar_ER) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_ER'
+func (ar *ar_ER) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_ER) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_ER) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_ER) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_ER) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_ER) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_ER) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_ER) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_ER) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_ER) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_ER) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_ER) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_ER) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_ER) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_ER) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_ER) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_ER) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_ER) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_ER' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_ER) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_ER' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_ER) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_ER'
+func (ar *ar_ER) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_ER'
+// in accounting notation.
+func (ar *ar_ER) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_ER'
+func (ar *ar_ER) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_ER/ar_ER_test.go b/vendor/github.com/go-playground/locales/ar_ER/ar_ER_test.go
new file mode 100644
index 000000000..6f323811b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_ER/ar_ER_test.go
@@ -0,0 +1,1120 @@
+package ar_ER
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_ER"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_IL/ar_IL.go b/vendor/github.com/go-playground/locales/ar_IL/ar_IL.go
new file mode 100644
index 000000000..15e1c7d2d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_IL/ar_IL.go
@@ -0,0 +1,673 @@
+package ar_IL
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_IL struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_IL' locale
+func New() locales.Translator {
+ return &ar_IL{
+ locale: "ar_IL",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"CLST": "توقيت شيلي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "VET": "توقيت فنزويلا", "NZST": "توقيت نيوزيلندا الرسمي", "GFT": "توقيت غايانا الفرنسية", "CLT": "توقيت شيلي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COT": "توقيت كولومبيا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "WIB": "توقيت غرب إندونيسيا", "JDT": "توقيت اليابان الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "CAT": "توقيت وسط أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "ART": "توقيت الأرجنتين الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "SAST": "توقيت جنوب أفريقيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AST": "التوقيت الرسمي الأطلسي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "WAT": "توقيت غرب أفريقيا الرسمي", "SGT": "توقيت سنغافورة", "HNOG": "توقيت غرب غرينلاند الرسمي", "WIT": "توقيت شرق إندونيسيا", "∅∅∅": "توقيت الأمازون الصيفي", "GYT": "توقيت غيانا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "WITA": "توقيت وسط إندونيسيا", "SRT": "توقيت سورينام", "TMST": "توقيت تركمانستان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "IST": "توقيت الهند", "WARST": "توقيت غرب الأرجنتين الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "HKT": "توقيت هونغ كونغ الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WAST": "توقيت غرب أفريقيا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "BOT": "توقيت بوليفيا", "HAT": "توقيت نيوفاوندلاند الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "BT": "توقيت بوتان", "MYT": "توقيت ماليزيا", "LHST": "توقيت لورد هاو الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "GMT": "توقيت غرينتش", "ChST": "توقيت تشامورو", "AWST": "توقيت غرب أستراليا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "UYST": "توقيت أوروغواي الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HEOG": "توقيت غرب غرينلاند الصيفي", "EAT": "توقيت شرق أفريقيا", "HNCU": "توقيت كوبا الرسمي", "HECU": "توقيت كوبا الصيفي", "ECT": "توقيت الإكوادور", "JST": "توقيت اليابان الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "COST": "توقيت كولومبيا الصيفي", "UYT": "توقيت أوروغواي الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AEST": "توقيت شرق أستراليا الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_IL) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_IL'
+func (ar *ar_IL) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_IL'
+func (ar *ar_IL) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_IL'
+func (ar *ar_IL) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_IL'
+func (ar *ar_IL) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_IL'
+func (ar *ar_IL) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_IL'
+func (ar *ar_IL) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_IL) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_IL) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_IL) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_IL) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_IL) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_IL) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_IL) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_IL) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_IL) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_IL) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_IL) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_IL) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_IL) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_IL) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_IL) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_IL) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_IL) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_IL' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_IL) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_IL' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_IL) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_IL'
+func (ar *ar_IL) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_IL'
+// in accounting notation.
+func (ar *ar_IL) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_IL'
+func (ar *ar_IL) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_IL/ar_IL_test.go b/vendor/github.com/go-playground/locales/ar_IL/ar_IL_test.go
new file mode 100644
index 000000000..78d37a1a6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_IL/ar_IL_test.go
@@ -0,0 +1,1120 @@
+package ar_IL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_IL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ.go b/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ.go
new file mode 100644
index 000000000..e33114ba8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ.go
@@ -0,0 +1,727 @@
+package ar_IQ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_IQ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_IQ' locale
+func New() locales.Translator {
+ return &ar_IQ{
+ locale: "ar_IQ",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين\u00a0الأول", "تشرين الثاني", "كانون الأول"},
+ monthsNarrow: []string{"", "ك", "ش", "آ", "ن", "أ", "ح", "ت", "آ", "أ", "ت", "ت", "ك"},
+ monthsWide: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"∅∅∅": "توقيت أزورس الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "GMT": "توقيت غرينتش", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNOG": "توقيت غرب غرينلاند الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "EAT": "توقيت شرق أفريقيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ECT": "توقيت الإكوادور", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "ART": "توقيت الأرجنتين الرسمي", "UYT": "توقيت أوروغواي الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "WESZ": "توقيت غرب أوروبا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CLST": "توقيت شيلي الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "JDT": "توقيت اليابان الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "MST": "MST", "NZDT": "توقيت نيوزيلندا الصيفي", "CAT": "توقيت وسط أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "CHADT": "توقيت تشاتام الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "SGT": "توقيت سنغافورة", "CLT": "توقيت شيلي الرسمي", "WIB": "توقيت غرب إندونيسيا", "HEEG": "توقيت شرق غرينلاند الصيفي", "VET": "توقيت فنزويلا", "WITA": "توقيت وسط إندونيسيا", "MDT": "MDT", "CHAST": "توقيت تشاتام الرسمي", "MYT": "توقيت ماليزيا", "AKDT": "توقيت ألاسكا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "WAST": "توقيت غرب أفريقيا الصيفي", "JST": "توقيت اليابان الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "SRT": "توقيت سورينام", "WIT": "توقيت شرق إندونيسيا", "HECU": "توقيت كوبا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "BT": "توقيت بوتان", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "GFT": "توقيت غايانا الفرنسية", "IST": "توقيت الهند", "HNT": "توقيت نيوفاوندلاند الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "ChST": "توقيت تشامورو", "HNCU": "توقيت كوبا الرسمي", "SAST": "توقيت جنوب أفريقيا", "BOT": "توقيت بوليفيا", "HNEG": "توقيت شرق غرينلاند الرسمي", "TMST": "توقيت تركمانستان الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "HAST": "توقيت هاواي ألوتيان الرسمي", "GYT": "توقيت غيانا", "AST": "التوقيت الرسمي الأطلسي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_IQ) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_IQ'
+func (ar *ar_IQ) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_IQ'
+func (ar *ar_IQ) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_IQ'
+func (ar *ar_IQ) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_IQ'
+func (ar *ar_IQ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_IQ'
+func (ar *ar_IQ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_IQ'
+func (ar *ar_IQ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_IQ) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_IQ) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_IQ) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_IQ) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_IQ) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_IQ) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_IQ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_IQ) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_IQ) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_IQ) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_IQ) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_IQ) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_IQ) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_IQ) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_IQ) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_IQ) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_IQ) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_IQ' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_IQ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_IQ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_IQ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_IQ'
+func (ar *ar_IQ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_IQ'
+// in accounting notation.
+func (ar *ar_IQ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_IQ'
+func (ar *ar_IQ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ_test.go b/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ_test.go
new file mode 100644
index 000000000..223372a8c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_IQ/ar_IQ_test.go
@@ -0,0 +1,1120 @@
+package ar_IQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_IQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_JO/ar_JO.go b/vendor/github.com/go-playground/locales/ar_JO/ar_JO.go
new file mode 100644
index 000000000..0bac1e260
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_JO/ar_JO.go
@@ -0,0 +1,727 @@
+package ar_JO
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_JO struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_JO' locale
+func New() locales.Translator {
+ return &ar_JO{
+ locale: "ar_JO",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ monthsNarrow: []string{"", "ك", "ش", "آ", "ن", "أ", "ح", "ت", "آ", "أ", "ت", "ت", "ك"},
+ monthsWide: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"UYT": "توقيت أوروغواي الرسمي", "AST": "التوقيت الرسمي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "JST": "توقيت اليابان الرسمي", "ECT": "توقيت الإكوادور", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "OEZ": "توقيت شرق أوروبا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "MYT": "توقيت ماليزيا", "HNOG": "توقيت غرب غرينلاند الرسمي", "SRT": "توقيت سورينام", "GYT": "توقيت غيانا", "CHADT": "توقيت تشاتام الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "WIT": "توقيت شرق إندونيسيا", "ART": "توقيت الأرجنتين الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WITA": "توقيت وسط إندونيسيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "MDT": "MDT", "SGT": "توقيت سنغافورة", "CLST": "توقيت شيلي الصيفي", "TMT": "توقيت تركمانستان الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "IST": "توقيت الهند", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "MEZ": "توقيت وسط أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "COT": "توقيت كولومبيا الرسمي", "ChST": "توقيت تشامورو", "HNCU": "توقيت كوبا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "CHAST": "توقيت تشاتام الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "CAT": "توقيت وسط أفريقيا", "CLT": "توقيت شيلي الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "LHST": "توقيت لورد هاو الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "TMST": "توقيت تركمانستان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "BT": "توقيت بوتان", "BOT": "توقيت بوليفيا", "JDT": "توقيت اليابان الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "VET": "توقيت فنزويلا", "∅∅∅": "توقيت الأمازون الصيفي", "HECU": "توقيت كوبا الصيفي", "WIB": "توقيت غرب إندونيسيا", "AKST": "التوقيت الرسمي لألاسكا", "HNT": "توقيت نيوفاوندلاند الرسمي", "MST": "MST", "EAT": "توقيت شرق أفريقيا", "GMT": "توقيت غرينتش", "UYST": "توقيت أوروغواي الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_JO) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_JO'
+func (ar *ar_JO) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_JO'
+func (ar *ar_JO) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_JO'
+func (ar *ar_JO) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_JO'
+func (ar *ar_JO) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_JO'
+func (ar *ar_JO) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_JO'
+func (ar *ar_JO) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_JO) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_JO) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_JO) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_JO) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_JO) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_JO) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_JO) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_JO) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_JO) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_JO) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_JO) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_JO) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_JO) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_JO) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_JO) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_JO) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_JO) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_JO' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_JO) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_JO' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_JO) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_JO'
+func (ar *ar_JO) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_JO'
+// in accounting notation.
+func (ar *ar_JO) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_JO'
+func (ar *ar_JO) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_JO/ar_JO_test.go b/vendor/github.com/go-playground/locales/ar_JO/ar_JO_test.go
new file mode 100644
index 000000000..372954937
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_JO/ar_JO_test.go
@@ -0,0 +1,1120 @@
+package ar_JO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_JO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_KM/ar_KM.go b/vendor/github.com/go-playground/locales/ar_KM/ar_KM.go
new file mode 100644
index 000000000..8ce6a15e6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_KM/ar_KM.go
@@ -0,0 +1,689 @@
+package ar_KM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_KM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_KM' locale
+func New() locales.Translator {
+ return &ar_KM{
+ locale: "ar_KM",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "CF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"PDT": "توقيت المحيط الهادي الصيفي", "SGT": "توقيت سنغافورة", "HNOG": "توقيت غرب غرينلاند الرسمي", "BT": "توقيت بوتان", "UYT": "توقيت أوروغواي الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AST": "التوقيت الرسمي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "UYST": "توقيت أوروغواي الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "TMST": "توقيت تركمانستان الصيفي", "EAT": "توقيت شرق أفريقيا", "CHADT": "توقيت تشاتام الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "ECT": "توقيت الإكوادور", "HAT": "توقيت نيوفاوندلاند الصيفي", "ART": "توقيت الأرجنتين الرسمي", "COST": "توقيت كولومبيا الصيفي", "HNCU": "توقيت كوبا الرسمي", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "IST": "توقيت الهند", "HNT": "توقيت نيوفاوندلاند الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "GYT": "توقيت غيانا", "ADT": "التوقيت الصيفي الأطلسي", "MYT": "توقيت ماليزيا", "OESZ": "توقيت شرق أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "GFT": "توقيت غايانا الفرنسية", "VET": "توقيت فنزويلا", "MDT": "MDT", "HECU": "توقيت كوبا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "COT": "توقيت كولومبيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ChST": "توقيت تشامورو", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WIB": "توقيت غرب إندونيسيا", "JDT": "توقيت اليابان الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "GMT": "توقيت غرينتش", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AEST": "توقيت شرق أستراليا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "MST": "MST", "SRT": "توقيت سورينام", "TMT": "توقيت تركمانستان الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "WITA": "توقيت وسط إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "WAT": "توقيت غرب أفريقيا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "WIT": "توقيت شرق إندونيسيا", "CAT": "توقيت وسط أفريقيا", "LHDT": "التوقيت الصيفي للورد هاو", "MEZ": "توقيت وسط أوروبا الرسمي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "AEDT": "توقيت شرق أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "JST": "توقيت اليابان الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_KM) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_KM'
+func (ar *ar_KM) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_KM'
+func (ar *ar_KM) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_KM'
+func (ar *ar_KM) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KM'
+func (ar *ar_KM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KM'
+func (ar *ar_KM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_KM'
+func (ar *ar_KM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_KM) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_KM) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_KM) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_KM) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_KM) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_KM) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_KM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_KM) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_KM) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_KM) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_KM) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_KM) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_KM) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_KM) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_KM) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_KM) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_KM) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_KM' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_KM) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_KM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_KM) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KM'
+func (ar *ar_KM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KM'
+// in accounting notation.
+func (ar *ar_KM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_KM'
+func (ar *ar_KM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_KM/ar_KM_test.go b/vendor/github.com/go-playground/locales/ar_KM/ar_KM_test.go
new file mode 100644
index 000000000..4fe9ad40a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_KM/ar_KM_test.go
@@ -0,0 +1,1120 @@
+package ar_KM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_KM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_KW/ar_KW.go b/vendor/github.com/go-playground/locales/ar_KW/ar_KW.go
new file mode 100644
index 000000000..ddc75a053
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_KW/ar_KW.go
@@ -0,0 +1,727 @@
+package ar_KW
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_KW struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_KW' locale
+func New() locales.Translator {
+ return &ar_KW{
+ locale: "ar_KW",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HEOG": "توقيت غرب غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "TMT": "توقيت تركمانستان الرسمي", "GMT": "توقيت غرينتش", "CHAST": "توقيت تشاتام الرسمي", "∅∅∅": "توقيت برازيليا الصيفي", "SGT": "توقيت سنغافورة", "COT": "توقيت كولومبيا الرسمي", "WITA": "توقيت وسط إندونيسيا", "HADT": "توقيت هاواي ألوتيان الصيفي", "COST": "توقيت كولومبيا الصيفي", "ChST": "توقيت تشامورو", "AWST": "توقيت غرب أستراليا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "UYST": "توقيت أوروغواي الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "AWDT": "توقيت غرب أستراليا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "WIB": "توقيت غرب إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "WESZ": "توقيت غرب أوروبا الصيفي", "WIT": "توقيت شرق إندونيسيا", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "EAT": "توقيت شرق أفريقيا", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "MYT": "توقيت ماليزيا", "AKDT": "توقيت ألاسكا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "CLT": "توقيت شيلي الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "GYT": "توقيت غيانا", "CHADT": "توقيت تشاتام الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "ECT": "توقيت الإكوادور", "MESZ": "توقيت وسط أوروبا الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "CAT": "توقيت وسط أفريقيا", "ART": "توقيت الأرجنتين الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "TMST": "توقيت تركمانستان الصيفي", "CLST": "توقيت شيلي الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "JDT": "توقيت اليابان الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "SAST": "توقيت جنوب أفريقيا", "JST": "توقيت اليابان الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "SRT": "توقيت سورينام", "ARST": "توقيت الأرجنتين الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "HNOG": "توقيت غرب غرينلاند الرسمي", "VET": "توقيت فنزويلا", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "IST": "توقيت الهند", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "HNCU": "توقيت كوبا الرسمي", "HECU": "توقيت كوبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "BT": "توقيت بوتان", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "LHST": "توقيت لورد هاو الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_KW) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_KW'
+func (ar *ar_KW) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_KW'
+func (ar *ar_KW) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_KW'
+func (ar *ar_KW) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KW'
+func (ar *ar_KW) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_KW'
+func (ar *ar_KW) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_KW'
+func (ar *ar_KW) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_KW) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_KW) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_KW) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_KW) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_KW) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_KW) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_KW) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_KW) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_KW) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_KW) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_KW) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_KW) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_KW) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_KW) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_KW) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_KW) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_KW) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_KW' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_KW) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_KW' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_KW) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KW'
+func (ar *ar_KW) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_KW'
+// in accounting notation.
+func (ar *ar_KW) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_KW'
+func (ar *ar_KW) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_KW/ar_KW_test.go b/vendor/github.com/go-playground/locales/ar_KW/ar_KW_test.go
new file mode 100644
index 000000000..5b07a3a70
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_KW/ar_KW_test.go
@@ -0,0 +1,1120 @@
+package ar_KW
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_KW"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_LB/ar_LB.go b/vendor/github.com/go-playground/locales/ar_LB/ar_LB.go
new file mode 100644
index 000000000..4ce8dffad
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_LB/ar_LB.go
@@ -0,0 +1,713 @@
+package ar_LB
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_LB struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_LB' locale
+func New() locales.Translator {
+ return &ar_LB{
+ locale: "ar_LB",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ monthsNarrow: []string{"", "ك", "ش", "آ", "ن", "أ", "ح", "ت", "آ", "أ", "ت", "ت", "ك"},
+ monthsWide: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "AKST": "التوقيت الرسمي لألاسكا", "SGT": "توقيت سنغافورة", "WIT": "توقيت شرق إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "JDT": "توقيت اليابان الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "CLT": "توقيت شيلي الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ChST": "توقيت تشامورو", "GFT": "توقيت غايانا الفرنسية", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "IST": "توقيت الهند", "MDT": "MDT", "TMT": "توقيت تركمانستان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "CHAST": "توقيت تشاتام الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "WIB": "توقيت غرب إندونيسيا", "NZST": "توقيت نيوزيلندا الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "MST": "MST", "COT": "توقيت كولومبيا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WEZ": "توقيت غرب أوروبا الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "WITA": "توقيت وسط إندونيسيا", "OESZ": "توقيت شرق أوروبا الصيفي", "HECU": "توقيت كوبا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "MEZ": "توقيت وسط أوروبا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "GYT": "توقيت غيانا", "SAST": "توقيت جنوب أفريقيا", "ECT": "توقيت الإكوادور", "HAT": "توقيت نيوفاوندلاند الصيفي", "MYT": "توقيت ماليزيا", "JST": "توقيت اليابان الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "VET": "توقيت فنزويلا", "EAT": "توقيت شرق أفريقيا", "CLST": "توقيت شيلي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "NZDT": "توقيت نيوزيلندا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "HKST": "توقيت هونغ كونغ الصيفي", "LHST": "توقيت لورد هاو الرسمي", "TMST": "توقيت تركمانستان الصيفي", "BT": "توقيت بوتان", "LHDT": "التوقيت الصيفي للورد هاو", "AEST": "توقيت شرق أستراليا الرسمي", "SRT": "توقيت سورينام", "PST": "توقيت المحيط الهادي الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "BOT": "توقيت بوليفيا", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "GMT": "توقيت غرينتش", "HNCU": "توقيت كوبا الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا", "UYT": "توقيت أوروغواي الرسمي", "UYST": "توقيت أوروغواي الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_LB) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_LB'
+func (ar *ar_LB) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_LB'
+func (ar *ar_LB) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_LB'
+func (ar *ar_LB) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_LB'
+func (ar *ar_LB) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_LB'
+func (ar *ar_LB) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_LB'
+func (ar *ar_LB) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_LB) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_LB) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_LB) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_LB) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_LB) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_LB) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_LB) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_LB) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_LB) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_LB) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_LB) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_LB) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_LB) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_LB) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_LB) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_LB) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_LB) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_LB' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_LB) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_LB' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_LB) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_LB'
+func (ar *ar_LB) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_LB'
+// in accounting notation.
+func (ar *ar_LB) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_LB'
+func (ar *ar_LB) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_LB/ar_LB_test.go b/vendor/github.com/go-playground/locales/ar_LB/ar_LB_test.go
new file mode 100644
index 000000000..694225c82
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_LB/ar_LB_test.go
@@ -0,0 +1,1120 @@
+package ar_LB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_LB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_LY/ar_LY.go b/vendor/github.com/go-playground/locales/ar_LY/ar_LY.go
new file mode 100644
index 000000000..8f51909bf
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_LY/ar_LY.go
@@ -0,0 +1,713 @@
+package ar_LY
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_LY struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_LY' locale
+func New() locales.Translator {
+ return &ar_LY{
+ locale: "ar_LY",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"", ""},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"WARST": "توقيت غرب الأرجنتين الصيفي", "MDT": "MDT", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "IST": "توقيت الهند", "ACDT": "توقيت وسط أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "CLST": "توقيت شيلي الصيفي", "COT": "توقيت كولومبيا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "AKDT": "توقيت ألاسكا الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "MESZ": "توقيت وسط أوروبا الصيفي", "VET": "توقيت فنزويلا", "HNT": "توقيت نيوفاوندلاند الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "GMT": "توقيت غرينتش", "ART": "توقيت الأرجنتين الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "LHDT": "التوقيت الصيفي للورد هاو", "MST": "MST", "EAT": "توقيت شرق أفريقيا", "PDT": "توقيت المحيط الهادي الصيفي", "BOT": "توقيت بوليفيا", "ECT": "توقيت الإكوادور", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "CLT": "توقيت شيلي الرسمي", "HNCU": "توقيت كوبا الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "SAST": "توقيت جنوب أفريقيا", "WART": "توقيت غرب الأرجنتين الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "WIT": "توقيت شرق إندونيسيا", "COST": "توقيت كولومبيا الصيفي", "WIB": "توقيت غرب إندونيسيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "SGT": "توقيت سنغافورة", "ACST": "توقيت وسط أستراليا الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "WEZ": "توقيت غرب أوروبا الرسمي", "JDT": "توقيت اليابان الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "BT": "توقيت بوتان", "NZST": "توقيت نيوزيلندا الرسمي", "MYT": "توقيت ماليزيا", "HKT": "توقيت هونغ كونغ الرسمي", "UYST": "توقيت أوروغواي الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WAST": "توقيت غرب أفريقيا الصيفي", "ChST": "توقيت تشامورو", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "HNOG": "توقيت غرب غرينلاند الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "LHST": "توقيت لورد هاو الرسمي", "TMST": "توقيت تركمانستان الصيفي", "SRT": "توقيت سورينام", "HAST": "توقيت هاواي ألوتيان الرسمي", "GYT": "توقيت غيانا", "AEDT": "توقيت شرق أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "JST": "توقيت اليابان الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CAT": "توقيت وسط أفريقيا", "OEZ": "توقيت شرق أوروبا الرسمي", "HECU": "توقيت كوبا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "TMT": "توقيت تركمانستان الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_LY) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_LY'
+func (ar *ar_LY) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_LY'
+func (ar *ar_LY) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_LY'
+func (ar *ar_LY) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_LY'
+func (ar *ar_LY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_LY'
+func (ar *ar_LY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_LY'
+func (ar *ar_LY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_LY) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_LY) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_LY) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_LY) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_LY) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_LY) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_LY) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_LY) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_LY) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_LY) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_LY) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_LY) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_LY) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_LY) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_LY) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_LY) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_LY) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_LY' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_LY) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_LY' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_LY) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_LY'
+func (ar *ar_LY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_LY'
+// in accounting notation.
+func (ar *ar_LY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_LY'
+func (ar *ar_LY) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_LY/ar_LY_test.go b/vendor/github.com/go-playground/locales/ar_LY/ar_LY_test.go
new file mode 100644
index 000000000..b5a125d61
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_LY/ar_LY_test.go
@@ -0,0 +1,1120 @@
+package ar_LY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_LY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_MA/ar_MA.go b/vendor/github.com/go-playground/locales/ar_MA/ar_MA.go
new file mode 100644
index 000000000..ac91635ed
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_MA/ar_MA.go
@@ -0,0 +1,675 @@
+package ar_MA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_MA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_MA' locale
+func New() locales.Translator {
+ return &ar_MA{
+ locale: "ar_MA",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "ماي", "يونيو", "يوليوز", "غشت", "شتنبر", "أكتوبر", "نونبر", "دجنبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "م", "ن", "ل", "غ", "ش", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "ماي", "يونيو", "يوليوز", "غشت", "شتنبر", "أكتوبر", "نونبر", "دجنبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"NZDT": "توقيت نيوزيلندا الصيفي", "ECT": "توقيت الإكوادور", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "BT": "توقيت بوتان", "MST": "MST", "CLST": "توقيت شيلي الصيفي", "WIT": "توقيت شرق إندونيسيا", "ARST": "توقيت الأرجنتين الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "HNCU": "توقيت كوبا الرسمي", "HECU": "توقيت كوبا الصيفي", "MYT": "توقيت ماليزيا", "AKDT": "توقيت ألاسكا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "WESZ": "توقيت غرب أوروبا الصيفي", "SGT": "توقيت سنغافورة", "OEZ": "توقيت شرق أوروبا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "GMT": "توقيت غرينتش", "WAT": "توقيت غرب أفريقيا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "ACST": "توقيت وسط أستراليا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "COT": "توقيت كولومبيا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "HEEG": "توقيت شرق غرينلاند الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "TMST": "توقيت تركمانستان الصيفي", "ART": "توقيت الأرجنتين الرسمي", "UYST": "توقيت أوروغواي الصيفي", "CHAST": "توقيت تشاتام الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "CAT": "توقيت وسط أفريقيا", "EAT": "توقيت شرق أفريقيا", "GYT": "توقيت غيانا", "JST": "توقيت اليابان الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "AWST": "توقيت غرب أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "LHST": "توقيت لورد هاو الرسمي", "COST": "توقيت كولومبيا الصيفي", "ChST": "توقيت تشامورو", "CLT": "توقيت شيلي الرسمي", "BOT": "توقيت بوليفيا", "ACDT": "توقيت وسط أستراليا الصيفي", "IST": "توقيت الهند", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "TMT": "توقيت تركمانستان الرسمي", "WIB": "توقيت غرب إندونيسيا", "HEOG": "توقيت غرب غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "VET": "توقيت فنزويلا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWDT": "توقيت غرب أستراليا الصيفي", "GFT": "توقيت غايانا الفرنسية", "∅∅∅": "توقيت أزورس الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MDT": "MDT", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WITA": "توقيت وسط إندونيسيا", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_MA) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_MA'
+func (ar *ar_MA) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_MA'
+func (ar *ar_MA) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_MA'
+func (ar *ar_MA) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_MA'
+func (ar *ar_MA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_MA'
+func (ar *ar_MA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_MA'
+func (ar *ar_MA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_MA) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_MA) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_MA) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_MA) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_MA) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_MA) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_MA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_MA) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_MA) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_MA) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_MA) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_MA) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_MA) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_MA) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_MA) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_MA) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_MA) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_MA' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_MA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_MA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_MA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_MA'
+func (ar *ar_MA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_MA'
+// in accounting notation.
+func (ar *ar_MA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_MA'
+func (ar *ar_MA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_MA/ar_MA_test.go b/vendor/github.com/go-playground/locales/ar_MA/ar_MA_test.go
new file mode 100644
index 000000000..11c68780e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_MA/ar_MA_test.go
@@ -0,0 +1,1120 @@
+package ar_MA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_MA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_MR/ar_MR.go b/vendor/github.com/go-playground/locales/ar_MR/ar_MR.go
new file mode 100644
index 000000000..0667c31d3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_MR/ar_MR.go
@@ -0,0 +1,713 @@
+package ar_MR
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_MR struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_MR' locale
+func New() locales.Translator {
+ return &ar_MR{
+ locale: "ar_MR",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "إبريل", "مايو", "يونيو", "يوليو", "أغشت", "شتمبر", "أكتوبر", "نوفمبر", "دجمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "إ", "و", "ن", "ل", "غ", "ش", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "إبريل", "مايو", "يونيو", "يوليو", "أغشت", "شتمبر", "أكتوبر", "نوفمبر", "دجمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"COT": "توقيت كولومبيا الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "HAST": "توقيت هاواي ألوتيان الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "ART": "توقيت الأرجنتين الرسمي", "SAST": "توقيت جنوب أفريقيا", "WEZ": "توقيت غرب أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "COST": "توقيت كولومبيا الصيفي", "BT": "توقيت بوتان", "ECT": "توقيت الإكوادور", "HNOG": "توقيت غرب غرينلاند الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "GFT": "توقيت غايانا الفرنسية", "OESZ": "توقيت شرق أوروبا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "TMST": "توقيت تركمانستان الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "EAT": "توقيت شرق أفريقيا", "CHAST": "توقيت تشاتام الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MST": "MST", "IST": "توقيت الهند", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "MDT": "MDT", "CLST": "توقيت شيلي الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "VET": "توقيت فنزويلا", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CAT": "توقيت وسط أفريقيا", "PDT": "توقيت المحيط الهادي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "BOT": "توقيت بوليفيا", "WITA": "توقيت وسط إندونيسيا", "HECU": "توقيت كوبا الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WAST": "توقيت غرب أفريقيا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CLT": "توقيت شيلي الرسمي", "HNCU": "توقيت كوبا الرسمي", "WIB": "توقيت غرب إندونيسيا", "JST": "توقيت اليابان الرسمي", "GMT": "توقيت غرينتش", "AST": "التوقيت الرسمي الأطلسي", "ChST": "توقيت تشامورو", "SGT": "توقيت سنغافورة", "∅∅∅": "توقيت أزورس الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "MYT": "توقيت ماليزيا", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "WIT": "توقيت شرق إندونيسيا", "LHDT": "التوقيت الصيفي للورد هاو", "SRT": "توقيت سورينام", "TMT": "توقيت تركمانستان الرسمي", "GYT": "توقيت غيانا", "NZST": "توقيت نيوزيلندا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACDT": "توقيت وسط أستراليا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_MR) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_MR'
+func (ar *ar_MR) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_MR'
+func (ar *ar_MR) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_MR'
+func (ar *ar_MR) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_MR'
+func (ar *ar_MR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_MR'
+func (ar *ar_MR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_MR'
+func (ar *ar_MR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_MR) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_MR) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_MR) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_MR) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_MR) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_MR) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_MR) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_MR) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_MR) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_MR) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_MR) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_MR) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_MR) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_MR) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_MR) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_MR) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_MR) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_MR' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_MR) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_MR' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_MR) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_MR'
+func (ar *ar_MR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_MR'
+// in accounting notation.
+func (ar *ar_MR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_MR'
+func (ar *ar_MR) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_MR/ar_MR_test.go b/vendor/github.com/go-playground/locales/ar_MR/ar_MR_test.go
new file mode 100644
index 000000000..0c9143499
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_MR/ar_MR_test.go
@@ -0,0 +1,1120 @@
+package ar_MR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_MR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_OM/ar_OM.go b/vendor/github.com/go-playground/locales/ar_OM/ar_OM.go
new file mode 100644
index 000000000..4b872b8f4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_OM/ar_OM.go
@@ -0,0 +1,727 @@
+package ar_OM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_OM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_OM' locale
+func New() locales.Translator {
+ return &ar_OM{
+ locale: "ar_OM",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ACST": "توقيت وسط أستراليا الرسمي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "MST": "MST", "WIT": "توقيت شرق إندونيسيا", "HECU": "توقيت كوبا الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "MDT": "MDT", "AWST": "توقيت غرب أستراليا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "SRT": "توقيت سورينام", "CAT": "توقيت وسط أفريقيا", "HNCU": "توقيت كوبا الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WAT": "توقيت غرب أفريقيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "IST": "توقيت الهند", "WART": "توقيت غرب الأرجنتين الرسمي", "SAST": "توقيت جنوب أفريقيا", "JDT": "توقيت اليابان الصيفي", "WITA": "توقيت وسط إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "MYT": "توقيت ماليزيا", "∅∅∅": "توقيت أزورس الصيفي", "VET": "توقيت فنزويلا", "EAT": "توقيت شرق أفريقيا", "WAST": "توقيت غرب أفريقيا الصيفي", "SGT": "توقيت سنغافورة", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWDT": "توقيت غرب أستراليا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "PST": "توقيت المحيط الهادي الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "LHST": "توقيت لورد هاو الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "TMST": "توقيت تركمانستان الصيفي", "UYST": "توقيت أوروغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WIB": "توقيت غرب إندونيسيا", "ECT": "توقيت الإكوادور", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "GYT": "توقيت غيانا", "AEDT": "توقيت شرق أستراليا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "GFT": "توقيت غايانا الفرنسية", "HAST": "توقيت هاواي ألوتيان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "JST": "توقيت اليابان الرسمي", "BT": "توقيت بوتان", "BOT": "توقيت بوليفيا", "AKDT": "توقيت ألاسكا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "GMT": "توقيت غرينتش", "UYT": "توقيت أوروغواي الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "CLT": "توقيت شيلي الرسمي", "CLST": "توقيت شيلي الصيفي", "ChST": "توقيت تشامورو", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "COT": "توقيت كولومبيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "NZDT": "توقيت نيوزيلندا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_OM) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_OM'
+func (ar *ar_OM) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_OM'
+func (ar *ar_OM) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_OM'
+func (ar *ar_OM) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_OM'
+func (ar *ar_OM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_OM'
+func (ar *ar_OM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_OM'
+func (ar *ar_OM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_OM) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_OM) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_OM) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_OM) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_OM) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_OM) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_OM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_OM) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_OM) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_OM) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_OM) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_OM) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_OM) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_OM) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_OM) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_OM) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_OM) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_OM' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_OM) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_OM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_OM) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_OM'
+func (ar *ar_OM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_OM'
+// in accounting notation.
+func (ar *ar_OM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_OM'
+func (ar *ar_OM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_OM/ar_OM_test.go b/vendor/github.com/go-playground/locales/ar_OM/ar_OM_test.go
new file mode 100644
index 000000000..33a5c8c9e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_OM/ar_OM_test.go
@@ -0,0 +1,1120 @@
+package ar_OM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_OM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_PS/ar_PS.go b/vendor/github.com/go-playground/locales/ar_PS/ar_PS.go
new file mode 100644
index 000000000..9856b2f0f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_PS/ar_PS.go
@@ -0,0 +1,727 @@
+package ar_PS
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_PS struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_PS' locale
+func New() locales.Translator {
+ return &ar_PS{
+ locale: "ar_PS",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ monthsNarrow: []string{"", "ك", "ش", "آ", "ن", "أ", "ح", "ت", "آ", "أ", "ت", "ت", "ك"},
+ monthsWide: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HAST": "توقيت هاواي ألوتيان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "CLST": "توقيت شيلي الصيفي", "SAST": "توقيت جنوب أفريقيا", "SGT": "توقيت سنغافورة", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "ART": "توقيت الأرجنتين الرسمي", "CHADT": "توقيت تشاتام الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "CHAST": "توقيت تشاتام الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "HNEG": "توقيت شرق غرينلاند الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "IST": "توقيت الهند", "CLT": "توقيت شيلي الرسمي", "CAT": "توقيت وسط أفريقيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "BOT": "توقيت بوليفيا", "GFT": "توقيت غايانا الفرنسية", "BT": "توقيت بوتان", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "WART": "توقيت غرب الأرجنتين الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HKT": "توقيت هونغ كونغ الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "GYT": "توقيت غيانا", "WIB": "توقيت غرب إندونيسيا", "NZDT": "توقيت نيوزيلندا الصيفي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "ChST": "توقيت تشامورو", "SRT": "توقيت سورينام", "HEOG": "توقيت غرب غرينلاند الصيفي", "COST": "توقيت كولومبيا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "GMT": "توقيت غرينتش", "PDT": "توقيت المحيط الهادي الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "NZST": "توقيت نيوزيلندا الرسمي", "JST": "توقيت اليابان الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "HADT": "توقيت هاواي ألوتيان الصيفي", "AEST": "توقيت شرق أستراليا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "UYT": "توقيت أوروغواي الرسمي", "HECU": "توقيت كوبا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AST": "التوقيت الرسمي الأطلسي", "TMT": "توقيت تركمانستان الرسمي", "TMST": "توقيت تركمانستان الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "VET": "توقيت فنزويلا", "HAT": "توقيت نيوفاوندلاند الصيفي", "EAT": "توقيت شرق أفريقيا", "WIT": "توقيت شرق إندونيسيا", "HNCU": "توقيت كوبا الرسمي", "MYT": "توقيت ماليزيا", "ECT": "توقيت الإكوادور", "AKDT": "توقيت ألاسكا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "JDT": "توقيت اليابان الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "WITA": "توقيت وسط إندونيسيا", "HNT": "توقيت نيوفاوندلاند الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_PS) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_PS'
+func (ar *ar_PS) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_PS'
+func (ar *ar_PS) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_PS'
+func (ar *ar_PS) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_PS'
+func (ar *ar_PS) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_PS'
+func (ar *ar_PS) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_PS'
+func (ar *ar_PS) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_PS) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_PS) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_PS) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_PS) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_PS) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_PS) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_PS) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_PS) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_PS) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_PS) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_PS) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_PS) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_PS) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_PS) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_PS) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_PS) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_PS) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_PS' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_PS) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_PS' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_PS) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_PS'
+func (ar *ar_PS) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_PS'
+// in accounting notation.
+func (ar *ar_PS) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_PS'
+func (ar *ar_PS) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_PS/ar_PS_test.go b/vendor/github.com/go-playground/locales/ar_PS/ar_PS_test.go
new file mode 100644
index 000000000..8feba658c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_PS/ar_PS_test.go
@@ -0,0 +1,1120 @@
+package ar_PS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_PS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_QA/ar_QA.go b/vendor/github.com/go-playground/locales/ar_QA/ar_QA.go
new file mode 100644
index 000000000..0e54cdbc8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_QA/ar_QA.go
@@ -0,0 +1,727 @@
+package ar_QA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_QA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_QA' locale
+func New() locales.Translator {
+ return &ar_QA{
+ locale: "ar_QA",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ECT": "توقيت الإكوادور", "MST": "MST", "ART": "توقيت الأرجنتين الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "JST": "توقيت اليابان الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "SGT": "توقيت سنغافورة", "CHAST": "توقيت تشاتام الرسمي", "CHADT": "توقيت تشاتام الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "UYT": "توقيت أوروغواي الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "GYT": "توقيت غيانا", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "COST": "توقيت كولومبيا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "SRT": "توقيت سورينام", "GMT": "توقيت غرينتش", "HECU": "توقيت كوبا الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "BT": "توقيت بوتان", "NZST": "توقيت نيوزيلندا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "CLT": "توقيت شيلي الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "JDT": "توقيت اليابان الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACST": "توقيت وسط أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WITA": "توقيت وسط إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "WIB": "توقيت غرب إندونيسيا", "LHDT": "التوقيت الصيفي للورد هاو", "WART": "توقيت غرب الأرجنتين الرسمي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "CLST": "توقيت شيلي الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "HNEG": "توقيت شرق غرينلاند الرسمي", "LHST": "توقيت لورد هاو الرسمي", "CAT": "توقيت وسط أفريقيا", "EAT": "توقيت شرق أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "WIT": "توقيت شرق إندونيسيا", "HNCU": "توقيت كوبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "HEOG": "توقيت غرب غرينلاند الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "MDT": "MDT", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "COT": "توقيت كولومبيا الرسمي", "ChST": "توقيت تشامورو", "WESZ": "توقيت غرب أوروبا الصيفي", "BOT": "توقيت بوليفيا", "IST": "توقيت الهند", "HAST": "توقيت هاواي ألوتيان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "GFT": "توقيت غايانا الفرنسية", "∅∅∅": "توقيت أزورس الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "NZDT": "توقيت نيوزيلندا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_QA) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_QA'
+func (ar *ar_QA) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_QA'
+func (ar *ar_QA) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_QA'
+func (ar *ar_QA) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_QA'
+func (ar *ar_QA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_QA'
+func (ar *ar_QA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_QA'
+func (ar *ar_QA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_QA) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_QA) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_QA) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_QA) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_QA) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_QA) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_QA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_QA) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_QA) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_QA) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_QA) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_QA) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_QA) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_QA) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_QA) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_QA) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_QA) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_QA' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_QA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_QA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_QA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_QA'
+func (ar *ar_QA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_QA'
+// in accounting notation.
+func (ar *ar_QA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_QA'
+func (ar *ar_QA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_QA/ar_QA_test.go b/vendor/github.com/go-playground/locales/ar_QA/ar_QA_test.go
new file mode 100644
index 000000000..78aea2aaf
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_QA/ar_QA_test.go
@@ -0,0 +1,1120 @@
+package ar_QA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_QA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SA/ar_SA.go b/vendor/github.com/go-playground/locales/ar_SA/ar_SA.go
new file mode 100644
index 000000000..078475993
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SA/ar_SA.go
@@ -0,0 +1,727 @@
+package ar_SA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_SA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_SA' locale
+func New() locales.Translator {
+ return &ar_SA{
+ locale: "ar_SA",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"", ""},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"CHAST": "توقيت تشاتام الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "COT": "توقيت كولومبيا الرسمي", "SRT": "توقيت سورينام", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "AST": "التوقيت الرسمي الأطلسي", "NZST": "توقيت نيوزيلندا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HEEG": "توقيت شرق غرينلاند الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "ChST": "توقيت تشامورو", "AWDT": "توقيت غرب أستراليا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CAT": "توقيت وسط أفريقيا", "CLT": "توقيت شيلي الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWST": "توقيت غرب أستراليا الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "WESZ": "توقيت غرب أوروبا الصيفي", "BOT": "توقيت بوليفيا", "ACDT": "توقيت وسط أستراليا الصيفي", "IST": "توقيت الهند", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "ECT": "توقيت الإكوادور", "GMT": "توقيت غرينتش", "∅∅∅": "توقيت برازيليا الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "JST": "توقيت اليابان الرسمي", "TMT": "توقيت تركمانستان الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "VET": "توقيت فنزويلا", "HADT": "توقيت هاواي ألوتيان الصيفي", "UYT": "توقيت أوروغواي الرسمي", "WIB": "توقيت غرب إندونيسيا", "LHST": "توقيت لورد هاو الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLST": "توقيت شيلي الصيفي", "ART": "توقيت الأرجنتين الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "SAST": "توقيت جنوب أفريقيا", "NZDT": "توقيت نيوزيلندا الصيفي", "GFT": "توقيت غايانا الفرنسية", "AKST": "التوقيت الرسمي لألاسكا", "WIT": "توقيت شرق إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "UYST": "توقيت أوروغواي الصيفي", "BT": "توقيت بوتان", "JDT": "توقيت اليابان الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "OEZ": "توقيت شرق أوروبا الرسمي", "COST": "توقيت كولومبيا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "OESZ": "توقيت شرق أوروبا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "EAT": "توقيت شرق أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "HECU": "توقيت كوبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AEDT": "توقيت شرق أستراليا الصيفي", "MYT": "توقيت ماليزيا", "WITA": "توقيت وسط إندونيسيا", "GYT": "توقيت غيانا", "CHADT": "توقيت تشاتام الصيفي", "HNCU": "توقيت كوبا الرسمي", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "SGT": "توقيت سنغافورة", "ACST": "توقيت وسط أستراليا الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_SA) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_SA'
+func (ar *ar_SA) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_SA'
+func (ar *ar_SA) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_SA'
+func (ar *ar_SA) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SA'
+func (ar *ar_SA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SA'
+func (ar *ar_SA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_SA'
+func (ar *ar_SA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_SA) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_SA) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_SA) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_SA) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_SA) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_SA) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_SA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_SA) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_SA) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_SA) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_SA) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_SA) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_SA) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_SA) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_SA) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_SA) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_SA) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_SA' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_SA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_SA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_SA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 9
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SA'
+func (ar *ar_SA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SA'
+// in accounting notation.
+func (ar *ar_SA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_SA'
+func (ar *ar_SA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SA/ar_SA_test.go b/vendor/github.com/go-playground/locales/ar_SA/ar_SA_test.go
new file mode 100644
index 000000000..798310e96
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SA/ar_SA_test.go
@@ -0,0 +1,1120 @@
+package ar_SA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SD/ar_SD.go b/vendor/github.com/go-playground/locales/ar_SD/ar_SD.go
new file mode 100644
index 000000000..51e76bd70
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SD/ar_SD.go
@@ -0,0 +1,727 @@
+package ar_SD
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_SD struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_SD' locale
+func New() locales.Translator {
+ return &ar_SD{
+ locale: "ar_SD",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"WESZ": "توقيت غرب أوروبا الصيفي", "LHST": "توقيت لورد هاو الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "UYST": "توقيت أوروغواي الصيفي", "HNCU": "توقيت كوبا الرسمي", "JST": "توقيت اليابان الرسمي", "HKST": "توقيت هونغ كونغ الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "CHADT": "توقيت تشاتام الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "ECT": "توقيت الإكوادور", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HNOG": "توقيت غرب غرينلاند الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WAT": "توقيت غرب أفريقيا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "TMT": "توقيت تركمانستان الرسمي", "CHAST": "توقيت تشاتام الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "NZST": "توقيت نيوزيلندا الرسمي", "SGT": "توقيت سنغافورة", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "IST": "توقيت الهند", "COT": "توقيت كولومبيا الرسمي", "GMT": "توقيت غرينتش", "AKDT": "توقيت ألاسكا الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "BT": "توقيت بوتان", "HKT": "توقيت هونغ كونغ الرسمي", "CLST": "توقيت شيلي الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "SRT": "توقيت سورينام", "CAT": "توقيت وسط أفريقيا", "CLT": "توقيت شيلي الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WIB": "توقيت غرب إندونيسيا", "MEZ": "توقيت وسط أوروبا الرسمي", "EAT": "توقيت شرق أفريقيا", "TMST": "توقيت تركمانستان الصيفي", "BOT": "توقيت بوليفيا", "ChST": "توقيت تشامورو", "HECU": "توقيت كوبا الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "PST": "توقيت المحيط الهادي الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "ACDT": "توقيت وسط أستراليا الصيفي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "WEZ": "توقيت غرب أوروبا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "WIT": "توقيت شرق إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ART": "توقيت الأرجنتين الرسمي", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "HEEG": "توقيت شرق غرينلاند الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "GYT": "توقيت غيانا", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "AEST": "توقيت شرق أستراليا الرسمي", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "MYT": "توقيت ماليزيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "UYT": "توقيت أوروغواي الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "JDT": "توقيت اليابان الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WITA": "توقيت وسط إندونيسيا", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_SD) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_SD'
+func (ar *ar_SD) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_SD'
+func (ar *ar_SD) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_SD'
+func (ar *ar_SD) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SD'
+func (ar *ar_SD) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SD'
+func (ar *ar_SD) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_SD'
+func (ar *ar_SD) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_SD) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_SD) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_SD) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_SD) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_SD) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_SD) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_SD) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_SD) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_SD) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_SD) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_SD) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_SD) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_SD) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_SD) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_SD) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_SD) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_SD) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_SD' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_SD) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_SD' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_SD) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SD'
+func (ar *ar_SD) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SD'
+// in accounting notation.
+func (ar *ar_SD) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_SD'
+func (ar *ar_SD) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SD/ar_SD_test.go b/vendor/github.com/go-playground/locales/ar_SD/ar_SD_test.go
new file mode 100644
index 000000000..1288f27ee
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SD/ar_SD_test.go
@@ -0,0 +1,1120 @@
+package ar_SD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SO/ar_SO.go b/vendor/github.com/go-playground/locales/ar_SO/ar_SO.go
new file mode 100644
index 000000000..4e4d108eb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SO/ar_SO.go
@@ -0,0 +1,727 @@
+package ar_SO
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_SO struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_SO' locale
+func New() locales.Translator {
+ return &ar_SO{
+ locale: "ar_SO",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "S", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HECU": "توقيت كوبا الصيفي", "WIB": "توقيت غرب إندونيسيا", "ACDT": "توقيت وسط أستراليا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CLST": "توقيت شيلي الصيفي", "∅∅∅": "توقيت الأمازون الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "CAT": "توقيت وسط أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "COT": "توقيت كولومبيا الرسمي", "SGT": "توقيت سنغافورة", "WART": "توقيت غرب الأرجنتين الرسمي", "VET": "توقيت فنزويلا", "ART": "توقيت الأرجنتين الرسمي", "HNCU": "توقيت كوبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "BOT": "توقيت بوليفيا", "WITA": "توقيت وسط إندونيسيا", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "UYST": "توقيت أوروغواي الصيفي", "ADT": "التوقيت الصيفي الأطلسي", "GFT": "توقيت غايانا الفرنسية", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "OESZ": "توقيت شرق أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "GMT": "توقيت غرينتش", "AWDT": "توقيت غرب أستراليا الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AEDT": "توقيت شرق أستراليا الصيفي", "ECT": "توقيت الإكوادور", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "SRT": "توقيت سورينام", "TMST": "توقيت تركمانستان الصيفي", "CHAST": "توقيت تشاتام الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "LHST": "توقيت لورد هاو الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "IST": "توقيت الهند", "LHDT": "التوقيت الصيفي للورد هاو", "MST": "MST", "CLT": "توقيت شيلي الرسمي", "CHADT": "توقيت تشاتام الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "AST": "التوقيت الرسمي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "ARST": "توقيت الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "AKDT": "توقيت ألاسكا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "PDT": "توقيت المحيط الهادي الصيفي", "BT": "توقيت بوتان", "SAST": "توقيت جنوب أفريقيا", "WEZ": "توقيت غرب أوروبا الرسمي", "MYT": "توقيت ماليزيا", "HEEG": "توقيت شرق غرينلاند الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "MDT": "MDT", "AEST": "توقيت شرق أستراليا الرسمي", "JDT": "توقيت اليابان الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HNEG": "توقيت شرق غرينلاند الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "WAT": "توقيت غرب أفريقيا الرسمي", "JST": "توقيت اليابان الرسمي", "WIT": "توقيت شرق إندونيسيا", "UYT": "توقيت أوروغواي الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "ChST": "توقيت تشامورو", "GYT": "توقيت غيانا", "PST": "توقيت المحيط الهادي الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_SO) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_SO'
+func (ar *ar_SO) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_SO'
+func (ar *ar_SO) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_SO'
+func (ar *ar_SO) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SO'
+func (ar *ar_SO) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SO'
+func (ar *ar_SO) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_SO'
+func (ar *ar_SO) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_SO) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_SO) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_SO) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_SO) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_SO) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_SO) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_SO) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_SO) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_SO) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_SO) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_SO) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_SO) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_SO) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_SO) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_SO) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_SO) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_SO) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_SO' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_SO) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_SO' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_SO) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 9
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SO'
+func (ar *ar_SO) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SO'
+// in accounting notation.
+func (ar *ar_SO) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_SO'
+func (ar *ar_SO) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SO/ar_SO_test.go b/vendor/github.com/go-playground/locales/ar_SO/ar_SO_test.go
new file mode 100644
index 000000000..6692fc05c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SO/ar_SO_test.go
@@ -0,0 +1,1120 @@
+package ar_SO
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SO"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SS/ar_SS.go b/vendor/github.com/go-playground/locales/ar_SS/ar_SS.go
new file mode 100644
index 000000000..7b7484644
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SS/ar_SS.go
@@ -0,0 +1,727 @@
+package ar_SS
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_SS struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_SS' locale
+func New() locales.Translator {
+ return &ar_SS{
+ locale: "ar_SS",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GB£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "£", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ART": "توقيت الأرجنتين الرسمي", "AST": "التوقيت الرسمي الأطلسي", "HEOG": "توقيت غرب غرينلاند الصيفي", "COT": "توقيت كولومبيا الرسمي", "∅∅∅": "توقيت الأمازون الصيفي", "ChST": "توقيت تشامورو", "CHAST": "توقيت تشاتام الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "AWDT": "توقيت غرب أستراليا الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "PDT": "توقيت المحيط الهادي الصيفي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "LHST": "توقيت لورد هاو الرسمي", "CLST": "توقيت شيلي الصيفي", "HECU": "توقيت كوبا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "IST": "توقيت الهند", "WAST": "توقيت غرب أفريقيا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "EAT": "توقيت شرق أفريقيا", "HAST": "توقيت هاواي ألوتيان الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "GYT": "توقيت غيانا", "AWST": "توقيت غرب أستراليا الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "NZST": "توقيت نيوزيلندا الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HKT": "توقيت هونغ كونغ الرسمي", "HNT": "توقيت نيوفاوندلاند الرسمي", "WIT": "توقيت شرق إندونيسيا", "WIB": "توقيت غرب إندونيسيا", "MYT": "توقيت ماليزيا", "AKST": "التوقيت الرسمي لألاسكا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "WART": "توقيت غرب الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "COST": "توقيت كولومبيا الصيفي", "HNCU": "توقيت كوبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "BT": "توقيت بوتان", "ACST": "توقيت وسط أستراليا الرسمي", "MDT": "MDT", "SRT": "توقيت سورينام", "ARST": "توقيت الأرجنتين الصيفي", "GMT": "توقيت غرينتش", "AEDT": "توقيت شرق أستراليا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "JST": "توقيت اليابان الرسمي", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "BOT": "توقيت بوليفيا", "VET": "توقيت فنزويلا", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "CLT": "توقيت شيلي الرسمي", "UYT": "توقيت أوروغواي الرسمي", "UYST": "توقيت أوروغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "CAT": "توقيت وسط أفريقيا", "TMT": "توقيت تركمانستان الرسمي", "SGT": "توقيت سنغافورة", "ECT": "توقيت الإكوادور", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HKST": "توقيت هونغ كونغ الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "MST": "MST", "OEZ": "توقيت شرق أوروبا الرسمي", "SAST": "توقيت جنوب أفريقيا", "GFT": "توقيت غايانا الفرنسية", "JDT": "توقيت اليابان الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_SS) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_SS'
+func (ar *ar_SS) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_SS'
+func (ar *ar_SS) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_SS'
+func (ar *ar_SS) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SS'
+func (ar *ar_SS) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SS'
+func (ar *ar_SS) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_SS'
+func (ar *ar_SS) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_SS) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_SS) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_SS) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_SS) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_SS) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_SS) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_SS) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_SS) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_SS) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_SS) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_SS) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_SS) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_SS) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_SS) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_SS) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_SS) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_SS) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_SS' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_SS) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_SS' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_SS) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SS'
+func (ar *ar_SS) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SS'
+// in accounting notation.
+func (ar *ar_SS) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_SS'
+func (ar *ar_SS) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SS/ar_SS_test.go b/vendor/github.com/go-playground/locales/ar_SS/ar_SS_test.go
new file mode 100644
index 000000000..3bfd45b21
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SS/ar_SS_test.go
@@ -0,0 +1,1120 @@
+package ar_SS
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SS"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SY/ar_SY.go b/vendor/github.com/go-playground/locales/ar_SY/ar_SY.go
new file mode 100644
index 000000000..99172253e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SY/ar_SY.go
@@ -0,0 +1,727 @@
+package ar_SY
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_SY struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_SY' locale
+func New() locales.Translator {
+ return &ar_SY{
+ locale: "ar_SY",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ monthsNarrow: []string{"", "ك", "ش", "آ", "ن", "أ", "ح", "ت", "آ", "أ", "ت", "ت", "ك"},
+ monthsWide: []string{"", "كانون الثاني", "شباط", "آذار", "نيسان", "أيار", "حزيران", "تموز", "آب", "أيلول", "تشرين الأول", "تشرين الثاني", "كانون الأول"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"SRT": "توقيت سورينام", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "AST": "التوقيت الرسمي الأطلسي", "NZDT": "توقيت نيوزيلندا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "IST": "توقيت الهند", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "∅∅∅": "توقيت بيرو الصيفي", "VET": "توقيت فنزويلا", "HNCU": "توقيت كوبا الرسمي", "PDT": "توقيت المحيط الهادي الصيفي", "WIB": "توقيت غرب إندونيسيا", "MYT": "توقيت ماليزيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNT": "توقيت نيوفاوندلاند الرسمي", "COT": "توقيت كولومبيا الرسمي", "ACST": "توقيت وسط أستراليا الرسمي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "LHST": "توقيت لورد هاو الرسمي", "MST": "MST", "AKDT": "توقيت ألاسكا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "WAT": "توقيت غرب أفريقيا الرسمي", "OEZ": "توقيت شرق أوروبا الرسمي", "ART": "توقيت الأرجنتين الرسمي", "GYT": "توقيت غيانا", "AWDT": "توقيت غرب أستراليا الصيفي", "BT": "توقيت بوتان", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "MDT": "MDT", "UYST": "توقيت أوروغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "WESZ": "توقيت غرب أوروبا الصيفي", "OESZ": "توقيت شرق أوروبا الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "GFT": "توقيت غايانا الفرنسية", "HNEG": "توقيت شرق غرينلاند الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CLT": "توقيت شيلي الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "CLST": "توقيت شيلي الصيفي", "ECT": "توقيت الإكوادور", "TMST": "توقيت تركمانستان الصيفي", "HECU": "توقيت كوبا الصيفي", "WITA": "توقيت وسط إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "GMT": "توقيت غرينتش", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "CAT": "توقيت وسط أفريقيا", "EAT": "توقيت شرق أفريقيا", "ARST": "توقيت الأرجنتين الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "ADT": "التوقيت الصيفي الأطلسي", "WAST": "توقيت غرب أفريقيا الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "LHDT": "التوقيت الصيفي للورد هاو", "WART": "توقيت غرب الأرجنتين الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "JST": "توقيت اليابان الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "SAST": "توقيت جنوب أفريقيا", "SGT": "توقيت سنغافورة", "HEOG": "توقيت غرب غرينلاند الصيفي", "ChST": "توقيت تشامورو", "AWST": "توقيت غرب أستراليا الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "BOT": "توقيت بوليفيا", "JDT": "توقيت اليابان الصيفي", "UYT": "توقيت أوروغواي الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "WIT": "توقيت شرق إندونيسيا", "CHAST": "توقيت تشاتام الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_SY) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_SY'
+func (ar *ar_SY) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_SY'
+func (ar *ar_SY) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_SY'
+func (ar *ar_SY) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SY'
+func (ar *ar_SY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_SY'
+func (ar *ar_SY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_SY'
+func (ar *ar_SY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_SY) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_SY) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_SY) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_SY) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_SY) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_SY) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_SY) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_SY) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_SY) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_SY) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_SY) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_SY) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_SY) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_SY) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_SY) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_SY) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_SY) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_SY' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_SY) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_SY' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_SY) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SY'
+func (ar *ar_SY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_SY'
+// in accounting notation.
+func (ar *ar_SY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_SY'
+func (ar *ar_SY) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_SY/ar_SY_test.go b/vendor/github.com/go-playground/locales/ar_SY/ar_SY_test.go
new file mode 100644
index 000000000..210ce72b6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_SY/ar_SY_test.go
@@ -0,0 +1,1120 @@
+package ar_SY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_SY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_TD/ar_TD.go b/vendor/github.com/go-playground/locales/ar_TD/ar_TD.go
new file mode 100644
index 000000000..569a66fb3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_TD/ar_TD.go
@@ -0,0 +1,727 @@
+package ar_TD
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_TD struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_TD' locale
+func New() locales.Translator {
+ return &ar_TD{
+ locale: "ar_TD",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ADT": "التوقيت الصيفي الأطلسي", "WESZ": "توقيت غرب أوروبا الصيفي", "AKST": "التوقيت الرسمي لألاسكا", "HNOG": "توقيت غرب غرينلاند الرسمي", "CHAST": "توقيت تشاتام الرسمي", "HNCU": "توقيت كوبا الرسمي", "AST": "التوقيت الرسمي الأطلسي", "ACDT": "توقيت وسط أستراليا الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "WART": "توقيت غرب الأرجنتين الرسمي", "WITA": "توقيت وسط إندونيسيا", "WEZ": "توقيت غرب أوروبا الرسمي", "NZST": "توقيت نيوزيلندا الرسمي", "BOT": "توقيت بوليفيا", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HEOG": "توقيت غرب غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "AEDT": "توقيت شرق أستراليا الصيفي", "JDT": "توقيت اليابان الصيفي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "LHDT": "التوقيت الصيفي للورد هاو", "CAT": "توقيت وسط أفريقيا", "ARST": "توقيت الأرجنتين الصيفي", "COT": "توقيت كولومبيا الرسمي", "BT": "توقيت بوتان", "AEST": "توقيت شرق أستراليا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "HEEG": "توقيت شرق غرينلاند الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "IST": "توقيت الهند", "EAT": "توقيت شرق أفريقيا", "CLST": "توقيت شيلي الصيفي", "HADT": "توقيت هاواي ألوتيان الصيفي", "GMT": "توقيت غرينتش", "MYT": "توقيت ماليزيا", "TMST": "توقيت تركمانستان الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "COST": "توقيت كولومبيا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "AKDT": "توقيت ألاسكا الصيفي", "ECT": "توقيت الإكوادور", "ACST": "توقيت وسط أستراليا الرسمي", "HNEG": "توقيت شرق غرينلاند الرسمي", "GYT": "توقيت غيانا", "MST": "MST", "MDT": "MDT", "SAST": "توقيت جنوب أفريقيا", "WAT": "توقيت غرب أفريقيا الرسمي", "SGT": "توقيت سنغافورة", "MEZ": "توقيت وسط أوروبا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "LHST": "توقيت لورد هاو الرسمي", "ChST": "توقيت تشامورو", "HECU": "توقيت كوبا الصيفي", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "JST": "توقيت اليابان الرسمي", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "PST": "توقيت المحيط الهادي الرسمي", "AWDT": "توقيت غرب أستراليا الصيفي", "WIT": "توقيت شرق إندونيسيا", "TMT": "توقيت تركمانستان الرسمي", "WIB": "توقيت غرب إندونيسيا", "NZDT": "توقيت نيوزيلندا الصيفي", "MESZ": "توقيت وسط أوروبا الصيفي", "WARST": "توقيت غرب الأرجنتين الصيفي", "HAT": "توقيت نيوفاوندلاند الصيفي", "SRT": "توقيت سورينام", "HAST": "توقيت هاواي ألوتيان الرسمي", "UYST": "توقيت أوروغواي الصيفي", "CHADT": "توقيت تشاتام الصيفي", "AWST": "توقيت غرب أستراليا الرسمي", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "∅∅∅": "∅∅∅", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "CLT": "توقيت شيلي الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "ART": "توقيت الأرجنتين الرسمي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_TD) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_TD'
+func (ar *ar_TD) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_TD'
+func (ar *ar_TD) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_TD'
+func (ar *ar_TD) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_TD'
+func (ar *ar_TD) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_TD'
+func (ar *ar_TD) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_TD'
+func (ar *ar_TD) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_TD) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_TD) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_TD) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_TD) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_TD) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_TD) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_TD) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_TD) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_TD) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_TD) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_TD) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_TD) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_TD) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_TD) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_TD) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_TD) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_TD) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_TD' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_TD) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_TD' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_TD) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_TD'
+func (ar *ar_TD) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_TD'
+// in accounting notation.
+func (ar *ar_TD) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_TD'
+func (ar *ar_TD) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_TD/ar_TD_test.go b/vendor/github.com/go-playground/locales/ar_TD/ar_TD_test.go
new file mode 100644
index 000000000..8067eb037
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_TD/ar_TD_test.go
@@ -0,0 +1,1120 @@
+package ar_TD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_TD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_TN/ar_TN.go b/vendor/github.com/go-playground/locales/ar_TN/ar_TN.go
new file mode 100644
index 000000000..dc4c368c1
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_TN/ar_TN.go
@@ -0,0 +1,713 @@
+package ar_TN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_TN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_TN' locale
+func New() locales.Translator {
+ return &ar_TN{
+ locale: "ar_TN",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ج", "ف", "م", "أ", "م", "ج", "ج", "أ", "س", "أ", "ن", "د"},
+ monthsWide: []string{"", "جانفي", "فيفري", "مارس", "أفريل", "ماي", "جوان", "جويلية", "أوت", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"ACWST": "توقيت غرب وسط أستراليا الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "ART": "توقيت الأرجنتين الرسمي", "GMT": "توقيت غرينتش", "CHAST": "توقيت تشاتام الرسمي", "WAT": "توقيت غرب أفريقيا الرسمي", "AKDT": "توقيت ألاسكا الصيفي", "PDT": "توقيت المحيط الهادي الصيفي", "CLST": "توقيت شيلي الصيفي", "HNT": "توقيت نيوفاوندلاند الرسمي", "CLT": "توقيت شيلي الرسمي", "TMST": "توقيت تركمانستان الصيفي", "WEZ": "توقيت غرب أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "WAST": "توقيت غرب أفريقيا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "SGT": "توقيت سنغافورة", "VET": "توقيت فنزويلا", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "AWST": "توقيت غرب أستراليا الرسمي", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "MYT": "توقيت ماليزيا", "OESZ": "توقيت شرق أوروبا الصيفي", "HECU": "توقيت كوبا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "SAST": "توقيت جنوب أفريقيا", "WART": "توقيت غرب الأرجنتين الرسمي", "ACDT": "توقيت وسط أستراليا الصيفي", "HEOG": "توقيت غرب غرينلاند الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "AST": "التوقيت الرسمي الأطلسي", "WIB": "توقيت غرب إندونيسيا", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "HNEG": "توقيت شرق غرينلاند الرسمي", "CAT": "توقيت وسط أفريقيا", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "GFT": "توقيت غايانا الفرنسية", "HKT": "توقيت هونغ كونغ الرسمي", "WARST": "توقيت غرب الأرجنتين الصيفي", "WITA": "توقيت وسط إندونيسيا", "WIT": "توقيت شرق إندونيسيا", "OEZ": "توقيت شرق أوروبا الرسمي", "ChST": "توقيت تشامورو", "WESZ": "توقيت غرب أوروبا الصيفي", "ACST": "توقيت وسط أستراليا الرسمي", "∅∅∅": "توقيت أزورس الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "MST": "MST", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "COT": "توقيت كولومبيا الرسمي", "MDT": "MDT", "HAST": "توقيت هاواي ألوتيان الرسمي", "COST": "توقيت كولومبيا الصيفي", "UYT": "توقيت أوروغواي الرسمي", "HNCU": "توقيت كوبا الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "AEST": "توقيت شرق أستراليا الرسمي", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "BT": "توقيت بوتان", "NZST": "توقيت نيوزيلندا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "LHDT": "التوقيت الصيفي للورد هاو", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "SRT": "توقيت سورينام", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "JST": "توقيت اليابان الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "NZDT": "توقيت نيوزيلندا الصيفي", "HNOG": "توقيت غرب غرينلاند الرسمي", "IST": "توقيت الهند", "HAT": "توقيت نيوفاوندلاند الصيفي", "EAT": "توقيت شرق أفريقيا", "GYT": "توقيت غيانا", "JDT": "توقيت اليابان الصيفي", "HEEG": "توقيت شرق غرينلاند الصيفي", "HKST": "توقيت هونغ كونغ الصيفي", "LHST": "توقيت لورد هاو الرسمي", "UYST": "توقيت أوروغواي الصيفي", "ECT": "توقيت الإكوادور", "MEZ": "توقيت وسط أوروبا الرسمي", "CHADT": "توقيت تشاتام الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "BOT": "توقيت بوليفيا"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_TN) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_TN'
+func (ar *ar_TN) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_TN'
+func (ar *ar_TN) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_TN'
+func (ar *ar_TN) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_TN'
+func (ar *ar_TN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_TN'
+func (ar *ar_TN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_TN'
+func (ar *ar_TN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_TN) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_TN) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_TN) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_TN) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_TN) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_TN) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_TN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_TN) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_TN) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_TN) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_TN) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_TN) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_TN) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_TN) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_TN) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_TN) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_TN) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_TN' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_TN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_TN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_TN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_TN'
+func (ar *ar_TN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_TN'
+// in accounting notation.
+func (ar *ar_TN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ar.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ar.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_TN'
+func (ar *ar_TN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_TN/ar_TN_test.go b/vendor/github.com/go-playground/locales/ar_TN/ar_TN_test.go
new file mode 100644
index 000000000..46c221a2c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_TN/ar_TN_test.go
@@ -0,0 +1,1120 @@
+package ar_TN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_TN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ar_YE/ar_YE.go b/vendor/github.com/go-playground/locales/ar_YE/ar_YE.go
new file mode 100644
index 000000000..48273ed6d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_YE/ar_YE.go
@@ -0,0 +1,727 @@
+package ar_YE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ar_YE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ar_YE' locale
+func New() locales.Translator {
+ return &ar_YE{
+ locale: "ar_YE",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{1, 4, 5, 6},
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ monthsNarrow: []string{"", "ي", "ف", "م", "أ", "و", "ن", "ل", "غ", "س", "ك", "ب", "د"},
+ monthsWide: []string{"", "يناير", "فبراير", "مارس", "أبريل", "مايو", "يونيو", "يوليو", "أغسطس", "سبتمبر", "أكتوبر", "نوفمبر", "ديسمبر"},
+ daysAbbreviated: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ daysNarrow: []string{"ح", "ن", "ث", "ر", "خ", "ج", "س"},
+ daysShort: []string{"أحد", "إثنين", "ثلاثاء", "أربعاء", "خميس", "جمعة", "سبت"},
+ daysWide: []string{"الأحد", "الاثنين", "الثلاثاء", "الأربعاء", "الخميس", "الجمعة", "السبت"},
+ periodsAbbreviated: []string{"ص", "م"},
+ periodsNarrow: []string{"ص", "م"},
+ periodsWide: []string{"ص", "م"},
+ erasAbbreviated: []string{"ق.م", "م"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"قبل الميلاد", "ميلادي"},
+ timezones: map[string]string{"HNCU": "توقيت كوبا الرسمي", "AKST": "التوقيت الرسمي لألاسكا", "WARST": "توقيت غرب الأرجنتين الصيفي", "IST": "توقيت الهند", "HNT": "توقيت نيوفاوندلاند الرسمي", "OESZ": "توقيت شرق أوروبا الصيفي", "ChST": "توقيت تشامورو", "HEPMX": "توقيت المحيط الهادي الصيفي للمكسيك", "WAST": "توقيت غرب أفريقيا الصيفي", "ACDT": "توقيت وسط أستراليا الصيفي", "WITA": "توقيت وسط إندونيسيا", "TMST": "توقيت تركمانستان الصيفي", "COT": "توقيت كولومبيا الرسمي", "HKT": "توقيت هونغ كونغ الرسمي", "HAT": "توقيت نيوفاوندلاند الصيفي", "CDT": "التوقيت الصيفي المركزي لأمريكا الشمالية", "PDT": "توقيت المحيط الهادي الصيفي", "WAT": "توقيت غرب أفريقيا الرسمي", "JST": "توقيت اليابان الرسمي", "HNOG": "توقيت غرب غرينلاند الرسمي", "EDT": "التوقيت الصيفي الشرقي لأمريكا الشمالية", "VET": "توقيت فنزويلا", "WIT": "توقيت شرق إندونيسيا", "MST": "التوقيت الجبلي الرسمي لأمريكا الشمالية", "SRT": "توقيت سورينام", "ART": "توقيت الأرجنتين الرسمي", "HAST": "توقيت هاواي ألوتيان الرسمي", "CHAST": "توقيت تشاتام الرسمي", "GYT": "توقيت غيانا", "HEEG": "توقيت شرق غرينلاند الصيفي", "EST": "التوقيت الرسمي الشرقي لأمريكا الشمالية", "MEZ": "توقيت وسط أوروبا الرسمي", "MESZ": "توقيت وسط أوروبا الصيفي", "UYST": "توقيت أوروغواي الصيفي", "GMT": "توقيت غرينتش", "MYT": "توقيت ماليزيا", "NZST": "توقيت نيوزيلندا الرسمي", "CLT": "توقيت شيلي الرسمي", "CAT": "توقيت وسط أفريقيا", "WIB": "توقيت غرب إندونيسيا", "BOT": "توقيت بوليفيا", "ACWDT": "توقيت غرب وسط أستراليا الصيفي", "LHDT": "التوقيت الصيفي للورد هاو", "HNPMX": "توقيت المحيط الهادي الرسمي للمكسيك", "CST": "التوقيت الرسمي المركزي لأمريكا الشمالية", "MDT": "التوقيت الجبلي الصيفي لأمريكا الشمالية", "NZDT": "توقيت نيوزيلندا الصيفي", "TMT": "توقيت تركمانستان الرسمي", "SGT": "توقيت سنغافورة", "HEPM": "توقيت سانت بيير وميكولون الصيفي", "HNPM": "توقيت سانت بيير وميكولون الرسمي", "EAT": "توقيت شرق أفريقيا", "AWST": "توقيت غرب أستراليا الرسمي", "AEST": "توقيت شرق أستراليا الرسمي", "SAST": "توقيت جنوب أفريقيا", "HKST": "توقيت هونغ كونغ الصيفي", "WART": "توقيت غرب الأرجنتين الرسمي", "LHST": "توقيت لورد هاو الرسمي", "HADT": "توقيت هاواي ألوتيان الصيفي", "AWDT": "توقيت غرب أستراليا الصيفي", "PST": "توقيت المحيط الهادي الرسمي", "WEZ": "توقيت غرب أوروبا الرسمي", "WESZ": "توقيت غرب أوروبا الصيفي", "∅∅∅": "∅∅∅", "HNEG": "توقيت شرق غرينلاند الرسمي", "AEDT": "توقيت شرق أستراليا الصيفي", "ECT": "توقيت الإكوادور", "HEOG": "توقيت غرب غرينلاند الصيفي", "HNNOMX": "التوقيت الرسمي لشمال غرب المكسيك", "GFT": "توقيت غايانا الفرنسية", "HENOMX": "التوقيت الصيفي لشمال غرب المكسيك", "CHADT": "توقيت تشاتام الصيفي", "AST": "التوقيت الرسمي الأطلسي", "ACST": "توقيت وسط أستراليا الرسمي", "CLST": "توقيت شيلي الصيفي", "ARST": "توقيت الأرجنتين الصيفي", "COST": "توقيت كولومبيا الصيفي", "OEZ": "توقيت شرق أوروبا الرسمي", "UYT": "توقيت أوروغواي الرسمي", "ADT": "التوقيت الصيفي الأطلسي", "JDT": "توقيت اليابان الصيفي", "BT": "توقيت بوتان", "AKDT": "توقيت ألاسكا الصيفي", "ACWST": "توقيت غرب وسط أستراليا الرسمي", "HECU": "توقيت كوبا الصيفي"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ar *ar_YE) Locale() string {
+ return ar.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ar_YE'
+func (ar *ar_YE) PluralsCardinal() []locales.PluralRule {
+ return ar.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ar_YE'
+func (ar *ar_YE) PluralsOrdinal() []locales.PluralRule {
+ return ar.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ar_YE'
+func (ar *ar_YE) PluralsRange() []locales.PluralRule {
+ return ar.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ar_YE'
+func (ar *ar_YE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if nMod100 >= 3 && nMod100 <= 10 {
+ return locales.PluralRuleFew
+ } else if nMod100 >= 11 && nMod100 <= 99 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ar_YE'
+func (ar *ar_YE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ar_YE'
+func (ar *ar_YE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := ar.CardinalPluralRule(num1, v1)
+ end := ar.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleZero
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ar *ar_YE) MonthAbbreviated(month time.Month) string {
+ return ar.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ar *ar_YE) MonthsAbbreviated() []string {
+ return ar.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ar *ar_YE) MonthNarrow(month time.Month) string {
+ return ar.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ar *ar_YE) MonthsNarrow() []string {
+ return ar.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ar *ar_YE) MonthWide(month time.Month) string {
+ return ar.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ar *ar_YE) MonthsWide() []string {
+ return ar.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ar *ar_YE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ar.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ar *ar_YE) WeekdaysAbbreviated() []string {
+ return ar.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ar *ar_YE) WeekdayNarrow(weekday time.Weekday) string {
+ return ar.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ar *ar_YE) WeekdaysNarrow() []string {
+ return ar.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ar *ar_YE) WeekdayShort(weekday time.Weekday) string {
+ return ar.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ar *ar_YE) WeekdaysShort() []string {
+ return ar.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ar *ar_YE) WeekdayWide(weekday time.Weekday) string {
+ return ar.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ar *ar_YE) WeekdaysWide() []string {
+ return ar.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ar *ar_YE) Decimal() string {
+ return ar.decimal
+}
+
+// Group returns the group of number
+func (ar *ar_YE) Group() string {
+ return ar.group
+}
+
+// Group returns the minus sign of number
+func (ar *ar_YE) Minus() string {
+ return ar.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ar_YE' and handles both Whole and Real numbers based on 'v'
+func (ar *ar_YE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ar_YE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ar *ar_YE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 11
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ar.percentSuffix...)
+
+ b = append(b, ar.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ar_YE'
+func (ar *ar_YE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ar.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ar_YE'
+// in accounting notation.
+func (ar *ar_YE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ar.currencies[currency]
+ l := len(s) + len(symbol) + 7 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ar.decimal) - 1; j >= 0; j-- {
+ b = append(b, ar.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ar.group) - 1; j >= 0; j-- {
+ b = append(b, ar.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ar.minus) - 1; j >= 0; j-- {
+ b = append(b, ar.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ar.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ar.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ar.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0xe2, 0x80, 0x8f, 0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ar.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0xd8, 0x8c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ar.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ar_YE'
+func (ar *ar_YE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ar.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ar.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ar.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ar.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ar_YE/ar_YE_test.go b/vendor/github.com/go-playground/locales/ar_YE/ar_YE_test.go
new file mode 100644
index 000000000..58451540d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ar_YE/ar_YE_test.go
@@ -0,0 +1,1120 @@
+package ar_YE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ar_YE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/as/as.go b/vendor/github.com/go-playground/locales/as/as.go
new file mode 100644
index 000000000..17a7a4dcb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/as/as.go
@@ -0,0 +1,706 @@
+package as
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type as struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'as' locale
+func New() locales.Translator {
+ return &as{
+ locale: "as",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "জানু", "ফেব্ৰু", "মাৰ্চ", "এপ্ৰিল", "মে’", "জুন", "জুলাই", "আগ", "ছেপ্তে", "অক্টো", "নৱে", "ডিচে"},
+ monthsNarrow: []string{"", "জ", "ফ", "ম", "এ", "ম", "জ", "জ", "আ", "ছ", "অ", "ন", "ড"},
+ monthsWide: []string{"", "জানুৱাৰী", "ফেব্ৰুৱাৰী", "মাৰ্চ", "এপ্ৰিল", "মে’", "জুন", "জুলাই", "আগষ্ট", "ছেপ্তেম্বৰ", "অক্টোবৰ", "নৱেম্বৰ", "ডিচেম্বৰ"},
+ daysAbbreviated: []string{"দেও", "সোম", "মঙ্গল", "বুধ", "বৃহ", "শুক্ৰ", "শনি"},
+ daysNarrow: []string{"দ", "স", "ম", "ব", "ব", "শ", "শ"},
+ daysShort: []string{"দেও", "সোম", "মঙ্গল", "বুধ", "বৃহ", "শুক্ৰ", "শনি"},
+ daysWide: []string{"দেওবাৰ", "সোমবাৰ", "মঙ্গলবাৰ", "বুধবাৰ", "বৃহস্পতিবাৰ", "শুক্ৰবাৰ", "শনিবাৰ"},
+ periodsAbbreviated: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ periodsNarrow: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ periodsWide: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"খ্ৰীষ্টপূৰ্ব", "খ্ৰীষ্টাব্দ"},
+ timezones: map[string]string{"AEDT": "অস্ট্রেলিয়ান পূর্ব দিবালোক সময়", "BT": "ভুটান টাইম", "WARST": "ওয়েস্টার্ন আর্জেন্টিনা গ্রীষ্মকালীন সময়", "IST": "ভাৰতীয় সময়", "WITA": "মধ্য ইন্দোনেশিয়া সময়", "WEZ": "পশ্চিম ইউরোপীয় মান সময়", "JDT": "জাপান দিনের হালকা সময়", "HEEG": "HEEG", "HENOMX": "HENOMX", "OEZ": "পূর্ব ইউরোপীয় মান সময়", "COT": "কলম্বিয়া মান সময়", "CST": "CST", "SAST": "দক্ষিণ আফ্রিকা মান সময়", "SGT": "সিঙ্গাপুর স্ট্যান্ডার্ড টাইম", "ACWST": "অস্ট্রেলিয়ান সেন্ট্রাল ওয়েস্টার্ন স্ট্যান্ডার্ড টাইম", "LHDT": "লর্ড হ্যালো দিবালোক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্ম সময়", "ART": "আৰ্জেণ্টিনা মান সময়", "PDT": "PDT", "AWST": "অস্ট্রেলিয়ান ওয়েস্টার্ন স্ট্যান্ডার্ড টাইম", "ADT": "ADT", "OESZ": "পূর্ব ইউরোপীয় গ্রীষ্মকালীন সময়", "BOT": "বলিভিয়া সময়", "ACST": "অস্ট্রেলিয়ান কেন্দ্রীয় স্ট্যান্ডার্ড টাইম", "ACDT": "অস্ট্রেলিয়ান কেন্দ্রীয় দিবালোক সময়", "CHAST": "চ্যাথাম স্ট্যান্ডার্ড টাইম", "∅∅∅": "ব্ৰাছিলিয়া গ্ৰীষ্ম সময়", "WIB": "ওয়েস্টার্ন ইন্দোনেশিয়া সময়", "AWDT": "অস্ট্রেলিয়ান ওয়েস্টার্ন ডেলাইট টাইম", "HNT": "HNT", "WIT": "ইস্টার্ন ইন্দোনেশিয়া সময়", "UYT": "উৰুগুৱে মান সময়", "HNCU": "HNCU", "HECU": "HECU", "PST": "PST", "HNNOMX": "HNNOMX", "ARST": "আৰ্জেণ্টিনা গ্ৰীষ্ম সময়", "WESZ": "পশ্চিম ইউরোপীয় গ্রীষ্মকালীন সময়", "NZST": "নিউজিল্যান্ড স্ট্যান্ডার্ড টাইম", "JST": "জাপান স্ট্যান্ডার্ড টাইম", "HKST": "হংকং গ্রীষ্মকালীন সময়", "LHST": "লর্ড হাভী স্ট্যান্ডার্ড টাইম", "CLT": "চিলি স্ট্যান্ডার্ড টাইম", "GYT": "গায়ানা টাইম", "ChST": "চামেরো স্ট্যান্ডার্ড টাইম", "HNPMX": "HNPMX", "WAST": "পশ্চিম আফ্রিকার গ্রীষ্মকালীন সময়", "VET": "ভেনিজুয়েলা সময়", "CAT": "মধ্য আফ্রিকা সময়", "CLST": "চিলি গ্রীষ্মকালীন সময়", "AKST": "AKST", "AKDT": "AKDT", "MEZ": "কেন্দ্রীয় ইউরোপীয় স্ট্যান্ডার্ড টাইম", "AEST": "অস্ট্রেলিয়ান ইস্টার্ন স্ট্যান্ডার্ড টাইম", "MYT": "মালয়েশিয়া সময়", "COST": "কলম্বিয়া গ্ৰীষ্ম সময়", "TMT": "তুর্কমেনিস্তান মান সময়", "CHADT": "চ্যাথাম ডেইলাইট টাইম", "AST": "AST", "EST": "EST", "GMT": "মক্কার সময়", "ECT": "ইকুৱেডৰ সময়", "EDT": "EDT", "HNPM": "HNPM", "GFT": "ফরাসি গায়ানা সময়", "HEPM": "HEPM", "CDT": "CDT", "MST": "MST", "MDT": "MDT", "HADT": "HADT", "HNEG": "HNEG", "HKT": "হংকং স্ট্যান্ডার্ড টাইম", "HAST": "HAST", "ACWDT": "অস্ট্রেলিয়ান সেন্ট্রাল ওয়েস্টার্ন ডেলাইট টাইম", "HNOG": "HNOG", "HEOG": "HEOG", "MESZ": "মধ্য ইউরোপীয় গ্রীষ্মকালীন সময়", "WART": "ওয়েস্টার্ন আর্জেন্টিনা মান সময়", "HEPMX": "HEPMX", "WAT": "পশ্চিম আফ্রিকার মান সময়", "NZDT": "নিউজিল্যান্ড ডেলাইট টাইম", "UYST": "উৰুগুৱে গ্ৰীষ্ম সময়", "HAT": "HAT", "SRT": "সুরিনাম টাইম", "EAT": "পূর্ব আফ্রিকা সময়"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (as *as) Locale() string {
+ return as.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'as'
+func (as *as) PluralsCardinal() []locales.PluralRule {
+ return as.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'as'
+func (as *as) PluralsOrdinal() []locales.PluralRule {
+ return as.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'as'
+func (as *as) PluralsRange() []locales.PluralRule {
+ return as.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'as'
+func (as *as) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'as'
+func (as *as) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
+ return locales.PluralRuleOne
+ } else if n == 2 || n == 3 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'as'
+func (as *as) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := as.CardinalPluralRule(num1, v1)
+ end := as.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (as *as) MonthAbbreviated(month time.Month) string {
+ return as.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (as *as) MonthsAbbreviated() []string {
+ return as.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (as *as) MonthNarrow(month time.Month) string {
+ return as.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (as *as) MonthsNarrow() []string {
+ return as.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (as *as) MonthWide(month time.Month) string {
+ return as.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (as *as) MonthsWide() []string {
+ return as.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (as *as) WeekdayAbbreviated(weekday time.Weekday) string {
+ return as.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (as *as) WeekdaysAbbreviated() []string {
+ return as.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (as *as) WeekdayNarrow(weekday time.Weekday) string {
+ return as.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (as *as) WeekdaysNarrow() []string {
+ return as.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (as *as) WeekdayShort(weekday time.Weekday) string {
+ return as.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (as *as) WeekdaysShort() []string {
+ return as.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (as *as) WeekdayWide(weekday time.Weekday) string {
+ return as.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (as *as) WeekdaysWide() []string {
+ return as.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (as *as) Decimal() string {
+ return as.decimal
+}
+
+// Group returns the group of number
+func (as *as) Group() string {
+ return as.group
+}
+
+// Group returns the minus sign of number
+func (as *as) Minus() string {
+ return as.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'as' and handles both Whole and Real numbers based on 'v'
+func (as *as) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'as' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (as *as) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, as.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'as'
+func (as *as) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := as.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, as.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'as'
+// in accounting notation.
+func (as *as) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := as.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyNegativePrefix[j])
+ }
+
+ b = append(b, as.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, as.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'as'
+func (as *as) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2d}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2d}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'as'
+func (as *as) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'as'
+func (as *as) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, as.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'as'
+func (as *as) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, as.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, as.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'as'
+func (as *as) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'as'
+func (as *as) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'as'
+func (as *as) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'as'
+func (as *as) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := as.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/as/as_test.go b/vendor/github.com/go-playground/locales/as/as_test.go
new file mode 100644
index 000000000..26c1d0b06
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/as/as_test.go
@@ -0,0 +1,1120 @@
+package as
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "as"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/as_IN/as_IN.go b/vendor/github.com/go-playground/locales/as_IN/as_IN.go
new file mode 100644
index 000000000..88d07ad06
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/as_IN/as_IN.go
@@ -0,0 +1,706 @@
+package as_IN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type as_IN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'as_IN' locale
+func New() locales.Translator {
+ return &as_IN{
+ locale: "as_IN",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "জানু", "ফেব্ৰু", "মাৰ্চ", "এপ্ৰিল", "মে’", "জুন", "জুলাই", "আগ", "ছেপ্তে", "অক্টো", "নৱে", "ডিচে"},
+ monthsNarrow: []string{"", "জ", "ফ", "ম", "এ", "ম", "জ", "জ", "আ", "ছ", "অ", "ন", "ড"},
+ monthsWide: []string{"", "জানুৱাৰী", "ফেব্ৰুৱাৰী", "মাৰ্চ", "এপ্ৰিল", "মে’", "জুন", "জুলাই", "আগষ্ট", "ছেপ্তেম্বৰ", "অক্টোবৰ", "নৱেম্বৰ", "ডিচেম্বৰ"},
+ daysAbbreviated: []string{"দেও", "সোম", "মঙ্গল", "বুধ", "বৃহ", "শুক্ৰ", "শনি"},
+ daysNarrow: []string{"দ", "স", "ম", "ব", "ব", "শ", "শ"},
+ daysShort: []string{"দেও", "সোম", "মঙ্গল", "বুধ", "বৃহ", "শুক্ৰ", "শনি"},
+ daysWide: []string{"দেওবাৰ", "সোমবাৰ", "মঙ্গলবাৰ", "বুধবাৰ", "বৃহস্পতিবাৰ", "শুক্ৰবাৰ", "শনিবাৰ"},
+ periodsAbbreviated: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ periodsNarrow: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ periodsWide: []string{"পূৰ্বাহ্ণ", "অপৰাহ্ণ"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"খ্ৰীষ্টপূৰ্ব", "খ্ৰীষ্টাব্দ"},
+ timezones: map[string]string{"CHAST": "চ্যাথাম স্ট্যান্ডার্ড টাইম", "AWST": "অস্ট্রেলিয়ান ওয়েস্টার্ন স্ট্যান্ডার্ড টাইম", "HEEG": "HEEG", "MESZ": "মধ্য ইউরোপীয় গ্রীষ্মকালীন সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্ম সময়", "OESZ": "পূর্ব ইউরোপীয় গ্রীষ্মকালীন সময়", "WITA": "মধ্য ইন্দোনেশিয়া সময়", "HNCU": "HNCU", "WEZ": "পশ্চিম ইউরোপীয় মান সময়", "IST": "ভাৰতীয় সময়", "HNT": "HNT", "CST": "CST", "AEDT": "অস্ট্রেলিয়ান পূর্ব দিবালোক সময়", "TMT": "তুর্কমেনিস্তান মান সময়", "COT": "কলম্বিয়া মান সময়", "WAT": "পশ্চিম আফ্রিকার মান সময়", "GFT": "ফরাসি গায়ানা সময়", "ACST": "অস্ট্রেলিয়ান কেন্দ্রীয় স্ট্যান্ডার্ড টাইম", "MDT": "MDT", "CLT": "চিলি স্ট্যান্ডার্ড টাইম", "HNPMX": "HNPMX", "ACWST": "অস্ট্রেলিয়ান সেন্ট্রাল ওয়েস্টার্ন স্ট্যান্ডার্ড টাইম", "ARST": "আৰ্জেণ্টিনা গ্ৰীষ্ম সময়", "EST": "EST", "HNNOMX": "HNNOMX", "ART": "আৰ্জেণ্টিনা মান সময়", "BOT": "বলিভিয়া সময়", "OEZ": "পূর্ব ইউরোপীয় মান সময়", "BT": "ভুটান টাইম", "CDT": "CDT", "PDT": "PDT", "AWDT": "অস্ট্রেলিয়ান ওয়েস্টার্ন ডেলাইট টাইম", "AEST": "অস্ট্রেলিয়ান ইস্টার্ন স্ট্যান্ডার্ড টাইম", "JDT": "জাপান দিনের হালকা সময়", "HAT": "HAT", "HECU": "HECU", "JST": "জাপান স্ট্যান্ডার্ড টাইম", "MYT": "মালয়েশিয়া সময়", "HNOG": "HNOG", "WIT": "ইস্টার্ন ইন্দোনেশিয়া সময়", "GMT": "মক্কার সময়", "EAT": "পূর্ব আফ্রিকা সময়", "MEZ": "কেন্দ্রীয় ইউরোপীয় স্ট্যান্ডার্ড টাইম", "UYST": "উৰুগুৱে গ্ৰীষ্ম সময়", "HEPMX": "HEPMX", "AST": "AST", "ECT": "ইকুৱেডৰ সময়", "EDT": "EDT", "CLST": "চিলি গ্রীষ্মকালীন সময়", "HADT": "HADT", "GYT": "গায়ানা টাইম", "ADT": "ADT", "NZST": "নিউজিল্যান্ড স্ট্যান্ডার্ড টাইম", "NZDT": "নিউজিল্যান্ড ডেলাইট টাইম", "ACWDT": "অস্ট্রেলিয়ান সেন্ট্রাল ওয়েস্টার্ন ডেলাইট টাইম", "CAT": "মধ্য আফ্রিকা সময়", "HAST": "HAST", "HEPM": "HEPM", "HNEG": "HNEG", "LHST": "লর্ড হাভী স্ট্যান্ডার্ড টাইম", "WARST": "ওয়েস্টার্ন আর্জেন্টিনা গ্রীষ্মকালীন সময়", "MST": "MST", "ChST": "চামেরো স্ট্যান্ডার্ড টাইম", "WAST": "পশ্চিম আফ্রিকার গ্রীষ্মকালীন সময়", "WIB": "ওয়েস্টার্ন ইন্দোনেশিয়া সময়", "HKT": "হংকং স্ট্যান্ডার্ড টাইম", "LHDT": "লর্ড হ্যালো দিবালোক সময়", "HNPM": "HNPM", "HENOMX": "HENOMX", "COST": "কলম্বিয়া গ্ৰীষ্ম সময়", "UYT": "উৰুগুৱে মান সময়", "CHADT": "চ্যাথাম ডেইলাইট টাইম", "WESZ": "পশ্চিম ইউরোপীয় গ্রীষ্মকালীন সময়", "AKST": "AKST", "WART": "ওয়েস্টার্ন আর্জেন্টিনা মান সময়", "∅∅∅": "পেরু গ্রীষ্মকালীন সময়", "SGT": "সিঙ্গাপুর স্ট্যান্ডার্ড টাইম", "HKST": "হংকং গ্রীষ্মকালীন সময়", "PST": "PST", "SAST": "দক্ষিণ আফ্রিকা মান সময়", "AKDT": "AKDT", "ACDT": "অস্ট্রেলিয়ান কেন্দ্রীয় দিবালোক সময়", "HEOG": "HEOG", "VET": "ভেনিজুয়েলা সময়", "SRT": "সুরিনাম টাইম"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (as *as_IN) Locale() string {
+ return as.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'as_IN'
+func (as *as_IN) PluralsCardinal() []locales.PluralRule {
+ return as.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'as_IN'
+func (as *as_IN) PluralsOrdinal() []locales.PluralRule {
+ return as.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'as_IN'
+func (as *as_IN) PluralsRange() []locales.PluralRule {
+ return as.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'as_IN'
+func (as *as_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'as_IN'
+func (as *as_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
+ return locales.PluralRuleOne
+ } else if n == 2 || n == 3 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'as_IN'
+func (as *as_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := as.CardinalPluralRule(num1, v1)
+ end := as.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (as *as_IN) MonthAbbreviated(month time.Month) string {
+ return as.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (as *as_IN) MonthsAbbreviated() []string {
+ return as.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (as *as_IN) MonthNarrow(month time.Month) string {
+ return as.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (as *as_IN) MonthsNarrow() []string {
+ return as.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (as *as_IN) MonthWide(month time.Month) string {
+ return as.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (as *as_IN) MonthsWide() []string {
+ return as.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (as *as_IN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return as.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (as *as_IN) WeekdaysAbbreviated() []string {
+ return as.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (as *as_IN) WeekdayNarrow(weekday time.Weekday) string {
+ return as.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (as *as_IN) WeekdaysNarrow() []string {
+ return as.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (as *as_IN) WeekdayShort(weekday time.Weekday) string {
+ return as.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (as *as_IN) WeekdaysShort() []string {
+ return as.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (as *as_IN) WeekdayWide(weekday time.Weekday) string {
+ return as.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (as *as_IN) WeekdaysWide() []string {
+ return as.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (as *as_IN) Decimal() string {
+ return as.decimal
+}
+
+// Group returns the group of number
+func (as *as_IN) Group() string {
+ return as.group
+}
+
+// Group returns the minus sign of number
+func (as *as_IN) Minus() string {
+ return as.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'as_IN' and handles both Whole and Real numbers based on 'v'
+func (as *as_IN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'as_IN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (as *as_IN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, as.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'as_IN'
+func (as *as_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := as.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, as.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, as.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'as_IN'
+// in accounting notation.
+func (as *as_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := as.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, as.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, as.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyNegativePrefix[j])
+ }
+
+ b = append(b, as.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(as.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, as.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, as.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'as_IN'
+func (as *as_IN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2d}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2d}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'as_IN'
+func (as *as_IN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'as_IN'
+func (as *as_IN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, as.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'as_IN'
+func (as *as_IN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, as.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, as.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'as_IN'
+func (as *as_IN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'as_IN'
+func (as *as_IN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'as_IN'
+func (as *as_IN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'as_IN'
+func (as *as_IN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, as.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, as.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := as.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/as_IN/as_IN_test.go b/vendor/github.com/go-playground/locales/as_IN/as_IN_test.go
new file mode 100644
index 000000000..bf0b3978c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/as_IN/as_IN_test.go
@@ -0,0 +1,1120 @@
+package as_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "as_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/asa/asa.go b/vendor/github.com/go-playground/locales/asa/asa.go
new file mode 100644
index 000000000..986666319
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/asa/asa.go
@@ -0,0 +1,535 @@
+package asa
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type asa struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'asa' locale
+func New() locales.Translator {
+ return &asa{
+ locale: "asa",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TSh", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Dec"},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"},
+ daysAbbreviated: []string{"Jpi", "Jtt", "Jnn", "Jtn", "Alh", "Ijm", "Jmo"},
+ daysNarrow: []string{"J", "J", "J", "J", "A", "I", "J"},
+ daysWide: []string{"Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi"},
+ periodsAbbreviated: []string{"icheheavo", "ichamthi"},
+ periodsWide: []string{"icheheavo", "ichamthi"},
+ erasAbbreviated: []string{"KM", "BM"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla yakwe Yethu", "Baada yakwe Yethu"},
+ timezones: map[string]string{"MST": "MST", "AEDT": "AEDT", "BOT": "BOT", "NZDT": "NZDT", "ART": "ART", "UYST": "UYST", "MYT": "MYT", "CAT": "CAT", "HNCU": "HNCU", "CDT": "CDT", "MDT": "MDT", "WAT": "WAT", "AKST": "AKST", "ACWST": "ACWST", "HAT": "HAT", "VET": "VET", "CLT": "CLT", "GYT": "GYT", "AST": "AST", "HNOG": "HNOG", "COT": "COT", "COST": "COST", "AEST": "AEST", "BT": "BT", "EST": "EST", "WART": "WART", "HNPM": "HNPM", "HADT": "HADT", "∅∅∅": "∅∅∅", "HNEG": "HNEG", "HEOG": "HEOG", "ACST": "ACST", "OEZ": "OEZ", "GMT": "GMT", "HECU": "HECU", "CST": "CST", "MEZ": "MEZ", "HKT": "HKT", "CLST": "CLST", "WIT": "WIT", "HAST": "HAST", "PDT": "PDT", "NZST": "NZST", "MESZ": "MESZ", "LHDT": "LHDT", "ARST": "ARST", "CHADT": "CHADT", "HEPMX": "HEPMX", "PST": "PST", "SAST": "SAST", "WAST": "WAST", "WITA": "WITA", "HENOMX": "HENOMX", "UYT": "UYT", "WESZ": "WESZ", "EDT": "EDT", "HNNOMX": "HNNOMX", "EAT": "EAT", "ChST": "ChST", "HNPMX": "HNPMX", "WEZ": "WEZ", "SGT": "SGT", "HEPM": "HEPM", "HNT": "HNT", "TMT": "TMT", "AWDT": "AWDT", "HKST": "HKST", "IST": "IST", "SRT": "SRT", "TMST": "TMST", "WIB": "WIB", "GFT": "GFT", "AKDT": "AKDT", "HEEG": "HEEG", "LHST": "LHST", "ADT": "ADT", "JST": "JST", "JDT": "JDT", "ECT": "ECT", "OESZ": "OESZ", "AWST": "AWST", "ACWDT": "ACWDT", "CHAST": "CHAST", "ACDT": "ACDT", "WARST": "WARST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (asa *asa) Locale() string {
+ return asa.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'asa'
+func (asa *asa) PluralsCardinal() []locales.PluralRule {
+ return asa.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'asa'
+func (asa *asa) PluralsOrdinal() []locales.PluralRule {
+ return asa.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'asa'
+func (asa *asa) PluralsRange() []locales.PluralRule {
+ return asa.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'asa'
+func (asa *asa) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'asa'
+func (asa *asa) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'asa'
+func (asa *asa) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (asa *asa) MonthAbbreviated(month time.Month) string {
+ return asa.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (asa *asa) MonthsAbbreviated() []string {
+ return asa.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (asa *asa) MonthNarrow(month time.Month) string {
+ return asa.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (asa *asa) MonthsNarrow() []string {
+ return asa.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (asa *asa) MonthWide(month time.Month) string {
+ return asa.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (asa *asa) MonthsWide() []string {
+ return asa.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (asa *asa) WeekdayAbbreviated(weekday time.Weekday) string {
+ return asa.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (asa *asa) WeekdaysAbbreviated() []string {
+ return asa.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (asa *asa) WeekdayNarrow(weekday time.Weekday) string {
+ return asa.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (asa *asa) WeekdaysNarrow() []string {
+ return asa.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (asa *asa) WeekdayShort(weekday time.Weekday) string {
+ return asa.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (asa *asa) WeekdaysShort() []string {
+ return asa.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (asa *asa) WeekdayWide(weekday time.Weekday) string {
+ return asa.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (asa *asa) WeekdaysWide() []string {
+ return asa.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (asa *asa) Decimal() string {
+ return asa.decimal
+}
+
+// Group returns the group of number
+func (asa *asa) Group() string {
+ return asa.group
+}
+
+// Group returns the minus sign of number
+func (asa *asa) Minus() string {
+ return asa.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'asa' and handles both Whole and Real numbers based on 'v'
+func (asa *asa) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'asa' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (asa *asa) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'asa'
+func (asa *asa) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := asa.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, asa.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, asa.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, asa.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, asa.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, asa.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'asa'
+// in accounting notation.
+func (asa *asa) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := asa.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, asa.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, asa.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, asa.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, asa.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, asa.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, asa.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'asa'
+func (asa *asa) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'asa'
+func (asa *asa) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'asa'
+func (asa *asa) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'asa'
+func (asa *asa) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, asa.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'asa'
+func (asa *asa) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'asa'
+func (asa *asa) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'asa'
+func (asa *asa) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'asa'
+func (asa *asa) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := asa.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/asa/asa_test.go b/vendor/github.com/go-playground/locales/asa/asa_test.go
new file mode 100644
index 000000000..80143c0b7
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/asa/asa_test.go
@@ -0,0 +1,1120 @@
+package asa
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "asa"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ.go b/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ.go
new file mode 100644
index 000000000..814416b0b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ.go
@@ -0,0 +1,535 @@
+package asa_TZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type asa_TZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'asa_TZ' locale
+func New() locales.Translator {
+ return &asa_TZ{
+ locale: "asa_TZ",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan", "Feb", "Mac", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Dec"},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"},
+ daysAbbreviated: []string{"Jpi", "Jtt", "Jnn", "Jtn", "Alh", "Ijm", "Jmo"},
+ daysNarrow: []string{"J", "J", "J", "J", "A", "I", "J"},
+ daysWide: []string{"Jumapili", "Jumatatu", "Jumanne", "Jumatano", "Alhamisi", "Ijumaa", "Jumamosi"},
+ periodsAbbreviated: []string{"icheheavo", "ichamthi"},
+ periodsWide: []string{"icheheavo", "ichamthi"},
+ erasAbbreviated: []string{"KM", "BM"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla yakwe Yethu", "Baada yakwe Yethu"},
+ timezones: map[string]string{"JST": "JST", "ACDT": "ACDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "OEZ": "OEZ", "CHAST": "CHAST", "WAST": "WAST", "GFT": "GFT", "HKST": "HKST", "WARST": "WARST", "AWST": "AWST", "ECT": "ECT", "MEZ": "MEZ", "HNT": "HNT", "HENOMX": "HENOMX", "MST": "MST", "WIT": "WIT", "PST": "PST", "HKT": "HKT", "GYT": "GYT", "CST": "CST", "SAST": "SAST", "EDT": "EDT", "WART": "WART", "WITA": "WITA", "MDT": "MDT", "COT": "COT", "WESZ": "WESZ", "AKST": "AKST", "CLST": "CLST", "ARST": "ARST", "WIB": "WIB", "NZST": "NZST", "SRT": "SRT", "EAT": "EAT", "WEZ": "WEZ", "GMT": "GMT", "ChST": "ChST", "AKDT": "AKDT", "CLT": "CLT", "PDT": "PDT", "HEPMX": "HEPMX", "AST": "AST", "AEDT": "AEDT", "OESZ": "OESZ", "UYST": "UYST", "CHADT": "CHADT", "CDT": "CDT", "VET": "VET", "HNPM": "HNPM", "CAT": "CAT", "UYT": "UYT", "ADT": "ADT", "HEOG": "HEOG", "SGT": "SGT", "IST": "IST", "TMT": "TMT", "COST": "COST", "HNCU": "HNCU", "WAT": "WAT", "BT": "BT", "ACST": "ACST", "MESZ": "MESZ", "LHST": "LHST", "BOT": "BOT", "HNEG": "HNEG", "HAT": "HAT", "∅∅∅": "∅∅∅", "AWDT": "AWDT", "HNPMX": "HNPMX", "NZDT": "NZDT", "EST": "EST", "HEEG": "HEEG", "TMST": "TMST", "HECU": "HECU", "MYT": "MYT", "JDT": "JDT", "HNNOMX": "HNNOMX", "HADT": "HADT", "AEST": "AEST", "HNOG": "HNOG", "HAST": "HAST", "ART": "ART", "LHDT": "LHDT", "HEPM": "HEPM"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (asa *asa_TZ) Locale() string {
+ return asa.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'asa_TZ'
+func (asa *asa_TZ) PluralsCardinal() []locales.PluralRule {
+ return asa.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'asa_TZ'
+func (asa *asa_TZ) PluralsOrdinal() []locales.PluralRule {
+ return asa.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'asa_TZ'
+func (asa *asa_TZ) PluralsRange() []locales.PluralRule {
+ return asa.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'asa_TZ'
+func (asa *asa_TZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'asa_TZ'
+func (asa *asa_TZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'asa_TZ'
+func (asa *asa_TZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (asa *asa_TZ) MonthAbbreviated(month time.Month) string {
+ return asa.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (asa *asa_TZ) MonthsAbbreviated() []string {
+ return asa.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (asa *asa_TZ) MonthNarrow(month time.Month) string {
+ return asa.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (asa *asa_TZ) MonthsNarrow() []string {
+ return asa.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (asa *asa_TZ) MonthWide(month time.Month) string {
+ return asa.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (asa *asa_TZ) MonthsWide() []string {
+ return asa.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (asa *asa_TZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return asa.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (asa *asa_TZ) WeekdaysAbbreviated() []string {
+ return asa.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (asa *asa_TZ) WeekdayNarrow(weekday time.Weekday) string {
+ return asa.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (asa *asa_TZ) WeekdaysNarrow() []string {
+ return asa.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (asa *asa_TZ) WeekdayShort(weekday time.Weekday) string {
+ return asa.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (asa *asa_TZ) WeekdaysShort() []string {
+ return asa.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (asa *asa_TZ) WeekdayWide(weekday time.Weekday) string {
+ return asa.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (asa *asa_TZ) WeekdaysWide() []string {
+ return asa.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (asa *asa_TZ) Decimal() string {
+ return asa.decimal
+}
+
+// Group returns the group of number
+func (asa *asa_TZ) Group() string {
+ return asa.group
+}
+
+// Group returns the minus sign of number
+func (asa *asa_TZ) Minus() string {
+ return asa.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'asa_TZ' and handles both Whole and Real numbers based on 'v'
+func (asa *asa_TZ) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'asa_TZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (asa *asa_TZ) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'asa_TZ'
+func (asa *asa_TZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := asa.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, asa.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, asa.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, asa.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, asa.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, asa.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'asa_TZ'
+// in accounting notation.
+func (asa *asa_TZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := asa.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, asa.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, asa.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, asa.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, asa.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, asa.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, asa.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, asa.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, asa.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'asa_TZ'
+func (asa *asa_TZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, asa.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := asa.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ_test.go b/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ_test.go
new file mode 100644
index 000000000..51ec9e4d9
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/asa_TZ/asa_TZ_test.go
@@ -0,0 +1,1120 @@
+package asa_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "asa_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ast/ast.go b/vendor/github.com/go-playground/locales/ast/ast.go
new file mode 100644
index 000000000..66875a455
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ast/ast.go
@@ -0,0 +1,596 @@
+package ast
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ast struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ast' locale
+func New() locales.Translator {
+ return &ast{
+ locale: "ast",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "xin", "feb", "mar", "abr", "may", "xun", "xnt", "ago", "set", "och", "pay", "avi"},
+ monthsNarrow: []string{"", "X", "F", "M", "A", "M", "X", "X", "A", "S", "O", "P", "A"},
+ monthsWide: []string{"", "de xineru", "de febreru", "de marzu", "d’abril", "de mayu", "de xunu", "de xunetu", "d’agostu", "de setiembre", "d’ochobre", "de payares", "d’avientu"},
+ daysAbbreviated: []string{"dom", "llu", "mar", "mié", "xue", "vie", "sáb"},
+ daysNarrow: []string{"D", "L", "M", "M", "X", "V", "S"},
+ daysShort: []string{"do", "ll", "ma", "mi", "xu", "vi", "sá"},
+ daysWide: []string{"domingu", "llunes", "martes", "miércoles", "xueves", "vienres", "sábadu"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"de la mañana", "de la tarde"},
+ erasAbbreviated: []string{"e.C.", "d.C."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"enantes de Cristu", "después de Cristu"},
+ timezones: map[string]string{"PDT": "Hora braniega del Pacíficu norteamericanu", "EDT": "Hora braniega del este norteamericanu", "ACWST": "Hora estándar d’Australia central del oeste", "HKST": "Hora braniega de Ḥong Kong", "SRT": "Hora del Surinam", "CHAST": "Hora estándar de Chatham", "SGT": "Hora estándar de Singapur", "HEPM": "Hora braniega de Saint Pierre y Miquelon", "EAT": "Hora d’África del este", "COT": "Hora estándar de Colombia", "COST": "Hora braniega de Colombia", "AWDT": "Hora braniega d’Australia del oeste", "AST": "Hora estándar del Atlánticu", "AKST": "Hora estándar d’Alaska", "CLST": "Hora braniega de Chile", "CHADT": "Hora braniega de Chatham", "LHDT": "Hora braniega de Lord Howe", "SAST": "Hora de Sudáfrica", "WESZ": "Hora braniega d’Europa Occidental", "JST": "Hora estándar de Xapón", "ACST": "Hora estándar d’Australia central", "HNOG": "Hora estándar de Groenlandia occidental", "MESZ": "Hora braniega d’Europa Central", "LHST": "Hora estándar de Lord Howe", "WART": "Hora estándar occidental d’Arxentina", "TMST": "Hora braniega del Turkmenistán", "AWST": "Hora estándar d’Australia del oeste", "NZDT": "Hora braniega de Nueva Zelanda", "HEOG": "Hora braniega de Groenlandia occidental", "TMT": "Hora estándar del Turkmenistán", "ART": "Hora estándar d’Arxentina", "UYT": "Hora estándar del Uruguái", "NZST": "Hora estándar de Nueva Zelanda", "MYT": "Hora de Malasia", "AKDT": "Hora braniega d’Alaska", "HADT": "Hora braniega de Hawaii-Aleutianes", "ChST": "Hora estándar de Chamorro", "HNPMX": "Hora estándar del Pacíficu de Méxicu", "WAST": "Hora braniega d’África del oeste", "IST": "Hora estándar de la India", "HNT": "Hora estándar de Newfoundland", "CAT": "Hora d’África central", "UYST": "Hora braniega del Uruguái", "HECU": "Hora braniega de Cuba", "PST": "Hora estándar del Pacíficu norteamericanu", "ADT": "Hora braniega del Atlánticu", "EST": "Hora estándar del este norteamericanu", "CLT": "Hora estándar de Chile", "OESZ": "Hora braniega d’Europa del Este", "HNCU": "Hora estándar de Cuba", "HEPMX": "Hora braniega del Pacíficu de Méxicu", "ACWDT": "Hora braniega d’Australia central del oeste", "GYT": "Hora de La Guyana", "GFT": "Hora de La Guyana Francesa", "HENOMX": "Hora braniega del noroeste de Méxicu", "MST": "Hora estándar de les montañes norteamericanes", "MDT": "Hora braniega de les montañes norteamericanes", "HEEG": "Hora braniega de Groenlandia oriental", "HKT": "Hora estándar de Ḥong Kong", "HNEG": "Hora estándar de Groenlandia oriental", "CST": "Hora estándar central norteamericana", "AEST": "Hora estándar d’Australia del este", "WAT": "Hora estándar d’África del oeste", "WEZ": "Hora estándar d’Europa Occidental", "BT": "Hora de Bután", "JDT": "Hora braniega de Xapón", "ACDT": "Hora braniega d’Australia central", "HAT": "Hora braniega de Newfoundland", "HNPM": "Hora estándar de Saint Pierre y Miquelon", "OEZ": "Hora estándar d’Europa del Este", "HAST": "Hora estándar de Hawaii-Aleutianes", "AEDT": "Hora braniega d’Australia del este", "WIB": "Hora d’Indonesia del oeste", "∅∅∅": "hora braniega d’Acre", "VET": "Hora de Venezuela", "CDT": "Hora braniega central norteamericana", "WITA": "Hora d’Indonesia central", "WIT": "Hora d’Indonesia del este", "WARST": "Hora braniega occidental d’Arxentina", "ARST": "Hora braniega d’Arxentina", "GMT": "Hora media de Greenwich", "BOT": "Hora de Bolivia", "ECT": "Hora d’Ecuador", "MEZ": "Hora estándar d’Europa Central", "HNNOMX": "Hora estándar del noroeste de Méxicu"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ast *ast) Locale() string {
+ return ast.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ast'
+func (ast *ast) PluralsCardinal() []locales.PluralRule {
+ return ast.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ast'
+func (ast *ast) PluralsOrdinal() []locales.PluralRule {
+ return ast.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ast'
+func (ast *ast) PluralsRange() []locales.PluralRule {
+ return ast.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ast'
+func (ast *ast) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ast'
+func (ast *ast) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ast'
+func (ast *ast) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ast *ast) MonthAbbreviated(month time.Month) string {
+ return ast.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ast *ast) MonthsAbbreviated() []string {
+ return ast.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ast *ast) MonthNarrow(month time.Month) string {
+ return ast.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ast *ast) MonthsNarrow() []string {
+ return ast.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ast *ast) MonthWide(month time.Month) string {
+ return ast.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ast *ast) MonthsWide() []string {
+ return ast.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ast *ast) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ast.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ast *ast) WeekdaysAbbreviated() []string {
+ return ast.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ast *ast) WeekdayNarrow(weekday time.Weekday) string {
+ return ast.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ast *ast) WeekdaysNarrow() []string {
+ return ast.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ast *ast) WeekdayShort(weekday time.Weekday) string {
+ return ast.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ast *ast) WeekdaysShort() []string {
+ return ast.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ast *ast) WeekdayWide(weekday time.Weekday) string {
+ return ast.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ast *ast) WeekdaysWide() []string {
+ return ast.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ast *ast) Decimal() string {
+ return ast.decimal
+}
+
+// Group returns the group of number
+func (ast *ast) Group() string {
+ return ast.group
+}
+
+// Group returns the minus sign of number
+func (ast *ast) Minus() string {
+ return ast.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ast' and handles both Whole and Real numbers based on 'v'
+func (ast *ast) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ast' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ast *ast) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ast.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ast'
+func (ast *ast) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ast.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ast.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ast.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ast'
+// in accounting notation.
+func (ast *ast) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ast.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ast.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ast.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ast.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ast.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ast'
+func (ast *ast) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ast'
+func (ast *ast) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ast'
+func (ast *ast) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ast'
+func (ast *ast) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ast.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ast'
+func (ast *ast) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ast'
+func (ast *ast) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ast'
+func (ast *ast) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ast'
+func (ast *ast) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ast.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ast/ast_test.go b/vendor/github.com/go-playground/locales/ast/ast_test.go
new file mode 100644
index 000000000..68adb2c70
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ast/ast_test.go
@@ -0,0 +1,1120 @@
+package ast
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ast"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ast_ES/ast_ES.go b/vendor/github.com/go-playground/locales/ast_ES/ast_ES.go
new file mode 100644
index 000000000..bde4e1611
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ast_ES/ast_ES.go
@@ -0,0 +1,596 @@
+package ast_ES
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ast_ES struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ast_ES' locale
+func New() locales.Translator {
+ return &ast_ES{
+ locale: "ast_ES",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "xin", "feb", "mar", "abr", "may", "xun", "xnt", "ago", "set", "och", "pay", "avi"},
+ monthsNarrow: []string{"", "X", "F", "M", "A", "M", "X", "X", "A", "S", "O", "P", "A"},
+ monthsWide: []string{"", "de xineru", "de febreru", "de marzu", "d’abril", "de mayu", "de xunu", "de xunetu", "d’agostu", "de setiembre", "d’ochobre", "de payares", "d’avientu"},
+ daysAbbreviated: []string{"dom", "llu", "mar", "mié", "xue", "vie", "sáb"},
+ daysNarrow: []string{"D", "L", "M", "M", "X", "V", "S"},
+ daysShort: []string{"do", "ll", "ma", "mi", "xu", "vi", "sá"},
+ daysWide: []string{"domingu", "llunes", "martes", "miércoles", "xueves", "vienres", "sábadu"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"de la mañana", "de la tarde"},
+ erasAbbreviated: []string{"e.C.", "d.C."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"enantes de Cristu", "después de Cristu"},
+ timezones: map[string]string{"BT": "Hora de Bután", "JDT": "Hora braniega de Xapón", "MEZ": "Hora estándar d’Europa Central", "LHDT": "Hora braniega de Lord Howe", "GYT": "Hora de La Guyana", "CST": "Hora estándar central norteamericana", "ACDT": "Hora braniega d’Australia central", "WITA": "Hora d’Indonesia central", "AWDT": "Hora braniega d’Australia del oeste", "HNPMX": "Hora estándar del Pacíficu de Méxicu", "WESZ": "Hora braniega d’Europa Occidental", "HKST": "Hora braniega de Ḥong Kong", "IST": "Hora estándar de la India", "AEST": "Hora estándar d’Australia del este", "AEDT": "Hora braniega d’Australia del este", "NZDT": "Hora braniega de Nueva Zelanda", "HKT": "Hora estándar de Ḥong Kong", "HNT": "Hora estándar de Newfoundland", "VET": "Hora de Venezuela", "HADT": "Hora braniega de Hawaii-Aleutianes", "COT": "Hora estándar de Colombia", "UYST": "Hora braniega del Uruguái", "HEPMX": "Hora braniega del Pacíficu de Méxicu", "SAST": "Hora de Sudáfrica", "WAT": "Hora estándar d’África del oeste", "NZST": "Hora estándar de Nueva Zelanda", "MYT": "Hora de Malasia", "HEPM": "Hora braniega de Saint Pierre y Miquelon", "HNNOMX": "Hora estándar del noroeste de Méxicu", "CAT": "Hora d’África central", "ADT": "Hora braniega del Atlánticu", "MDT": "Hora braniega de les montañes norteamericanes", "GMT": "Hora media de Greenwich", "ChST": "Hora estándar de Chamorro", "PST": "Hora estándar del Pacíficu norteamericanu", "HNEG": "Hora estándar de Groenlandia oriental", "HEEG": "Hora braniega de Groenlandia oriental", "HENOMX": "Hora braniega del noroeste de Méxicu", "CLST": "Hora braniega de Chile", "OEZ": "Hora estándar d’Europa del Este", "OESZ": "Hora braniega d’Europa del Este", "UYT": "Hora estándar del Uruguái", "AST": "Hora estándar del Atlánticu", "SGT": "Hora estándar de Singapur", "ARST": "Hora braniega d’Arxentina", "CHADT": "Hora braniega de Chatham", "PDT": "Hora braniega del Pacíficu norteamericanu", "MST": "Hora estándar de les montañes norteamericanes", "HNOG": "Hora estándar de Groenlandia occidental", "HEOG": "Hora braniega de Groenlandia occidental", "HAT": "Hora braniega de Newfoundland", "CDT": "Hora braniega central norteamericana", "WIB": "Hora d’Indonesia del oeste", "GFT": "Hora de La Guyana Francesa", "ECT": "Hora d’Ecuador", "WART": "Hora estándar occidental d’Arxentina", "WARST": "Hora braniega occidental d’Arxentina", "HNPM": "Hora estándar de Saint Pierre y Miquelon", "SRT": "Hora del Surinam", "EAT": "Hora d’África del este", "HNCU": "Hora estándar de Cuba", "WAST": "Hora braniega d’África del oeste", "AKDT": "Hora braniega d’Alaska", "ACST": "Hora estándar d’Australia central", "MESZ": "Hora braniega d’Europa Central", "ACWDT": "Hora braniega d’Australia central del oeste", "CLT": "Hora estándar de Chile", "TMT": "Hora estándar del Turkmenistán", "HECU": "Hora braniega de Cuba", "EST": "Hora estándar del este norteamericanu", "EDT": "Hora braniega del este norteamericanu", "ACWST": "Hora estándar d’Australia central del oeste", "LHST": "Hora estándar de Lord Howe", "ART": "Hora estándar d’Arxentina", "COST": "Hora braniega de Colombia", "CHAST": "Hora estándar de Chatham", "JST": "Hora estándar de Xapón", "AKST": "Hora estándar d’Alaska", "∅∅∅": "hora braniega d’Acre", "BOT": "Hora de Bolivia", "WIT": "Hora d’Indonesia del este", "TMST": "Hora braniega del Turkmenistán", "HAST": "Hora estándar de Hawaii-Aleutianes", "AWST": "Hora estándar d’Australia del oeste", "WEZ": "Hora estándar d’Europa Occidental"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ast *ast_ES) Locale() string {
+ return ast.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ast_ES'
+func (ast *ast_ES) PluralsCardinal() []locales.PluralRule {
+ return ast.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ast_ES'
+func (ast *ast_ES) PluralsOrdinal() []locales.PluralRule {
+ return ast.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ast_ES'
+func (ast *ast_ES) PluralsRange() []locales.PluralRule {
+ return ast.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ast_ES'
+func (ast *ast_ES) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ast_ES'
+func (ast *ast_ES) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ast_ES'
+func (ast *ast_ES) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ast *ast_ES) MonthAbbreviated(month time.Month) string {
+ return ast.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ast *ast_ES) MonthsAbbreviated() []string {
+ return ast.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ast *ast_ES) MonthNarrow(month time.Month) string {
+ return ast.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ast *ast_ES) MonthsNarrow() []string {
+ return ast.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ast *ast_ES) MonthWide(month time.Month) string {
+ return ast.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ast *ast_ES) MonthsWide() []string {
+ return ast.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ast *ast_ES) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ast.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ast *ast_ES) WeekdaysAbbreviated() []string {
+ return ast.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ast *ast_ES) WeekdayNarrow(weekday time.Weekday) string {
+ return ast.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ast *ast_ES) WeekdaysNarrow() []string {
+ return ast.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ast *ast_ES) WeekdayShort(weekday time.Weekday) string {
+ return ast.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ast *ast_ES) WeekdaysShort() []string {
+ return ast.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ast *ast_ES) WeekdayWide(weekday time.Weekday) string {
+ return ast.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ast *ast_ES) WeekdaysWide() []string {
+ return ast.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ast *ast_ES) Decimal() string {
+ return ast.decimal
+}
+
+// Group returns the group of number
+func (ast *ast_ES) Group() string {
+ return ast.group
+}
+
+// Group returns the minus sign of number
+func (ast *ast_ES) Minus() string {
+ return ast.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ast_ES' and handles both Whole and Real numbers based on 'v'
+func (ast *ast_ES) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ast_ES' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ast *ast_ES) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ast.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ast_ES'
+func (ast *ast_ES) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ast.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ast.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ast.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ast.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ast_ES'
+// in accounting notation.
+func (ast *ast_ES) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ast.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ast.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ast.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ast.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ast.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ast.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ast.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ast.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ast.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ast_ES'
+func (ast *ast_ES) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ast.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ast.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ast_ES/ast_ES_test.go b/vendor/github.com/go-playground/locales/ast_ES/ast_ES_test.go
new file mode 100644
index 000000000..284c8e17a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ast_ES/ast_ES_test.go
@@ -0,0 +1,1120 @@
+package ast_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ast_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/az/az.go b/vendor/github.com/go-playground/locales/az/az.go
new file mode 100644
index 000000000..2ec04c24e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az/az.go
@@ -0,0 +1,643 @@
+package az
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type az struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'az' locale
+func New() locales.Translator {
+ return &az{
+ locale: "az",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "₼", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "yan", "fev", "mar", "apr", "may", "iyn", "iyl", "avq", "sen", "okt", "noy", "dek"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "yanvar", "fevral", "mart", "aprel", "may", "iyun", "iyul", "avqust", "sentyabr", "oktyabr", "noyabr", "dekabr"},
+ daysAbbreviated: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysNarrow: []string{"7", "1", "2", "3", "4", "5", "6"},
+ daysShort: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysWide: []string{"bazar", "bazar ertəsi", "çərşənbə axşamı", "çərşənbə", "cümə axşamı", "cümə", "şənbə"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"e.ə.", "y.e."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"eramızdan əvvəl", "yeni era"},
+ timezones: map[string]string{"EDT": "Şimali Şərqi Amerika Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "∅∅∅": "∅∅∅", "HENOMX": "Şimal-Qərbi Meksika Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "HEOG": "Qərbi Qrenlandiya Yay Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "HNOG": "Qərbi Qrenlandiya Standart Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "AKST": "Alyaska Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "SAST": "Cənubi Afrika Vaxtı", "HNEG": "Şərqi Qrenlandiya Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "HEEG": "Şərqi Qrenlandiya Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "BOT": "Boliviya Vaxtı", "ECT": "Ekvador Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "ChST": "Çamorro Vaxtı", "IST": "Hindistan Vaxtı", "HNNOMX": "Şimal-Qərbi Meksika Standart Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "MYT": "Malayziya Vaxtı", "HNPM": "Müqəddəs Pyer və Mikelon Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "GYT": "Qayana Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "BT": "Butan Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "HEPMX": "Meksika Sakit Okean Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "SRT": "Surinam Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "JST": "Yaponiya Standart Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "CLST": "Çili Yay Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "HNPMX": "Meksika Sakit Okean Standart Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "HEPM": "Müqəddəs Pyer və Mikelon Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "HNCU": "Kuba Standart Vaxtı", "HECU": "Kuba Yay Vaxtı", "ARST": "Argentina Yay Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "VET": "Venesuela Vaxtı", "CLT": "Çili Standart Vaxtı"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (az *az) Locale() string {
+ return az.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'az'
+func (az *az) PluralsCardinal() []locales.PluralRule {
+ return az.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'az'
+func (az *az) PluralsOrdinal() []locales.PluralRule {
+ return az.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'az'
+func (az *az) PluralsRange() []locales.PluralRule {
+ return az.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'az'
+func (az *az) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'az'
+func (az *az) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ iMod1000 := i % 1000
+ iMod10 := i % 10
+ iMod100 := i % 100
+
+ if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
+ return locales.PluralRuleOne
+ } else if (iMod10 == 3 || iMod10 == 4) || (iMod1000 == 100 || iMod1000 == 200 || iMod1000 == 300 || iMod1000 == 400 || iMod1000 == 500 || iMod1000 == 600 || iMod1000 == 700 || iMod1000 == 800 || iMod1000 == 900) {
+ return locales.PluralRuleFew
+ } else if (i == 0) || (iMod10 == 6) || (iMod100 == 40 || iMod100 == 60 || iMod100 == 90) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'az'
+func (az *az) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := az.CardinalPluralRule(num1, v1)
+ end := az.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (az *az) MonthAbbreviated(month time.Month) string {
+ return az.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (az *az) MonthsAbbreviated() []string {
+ return az.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (az *az) MonthNarrow(month time.Month) string {
+ return az.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (az *az) MonthsNarrow() []string {
+ return az.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (az *az) MonthWide(month time.Month) string {
+ return az.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (az *az) MonthsWide() []string {
+ return az.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (az *az) WeekdayAbbreviated(weekday time.Weekday) string {
+ return az.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (az *az) WeekdaysAbbreviated() []string {
+ return az.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (az *az) WeekdayNarrow(weekday time.Weekday) string {
+ return az.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (az *az) WeekdaysNarrow() []string {
+ return az.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (az *az) WeekdayShort(weekday time.Weekday) string {
+ return az.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (az *az) WeekdaysShort() []string {
+ return az.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (az *az) WeekdayWide(weekday time.Weekday) string {
+ return az.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (az *az) WeekdaysWide() []string {
+ return az.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (az *az) Decimal() string {
+ return az.decimal
+}
+
+// Group returns the group of number
+func (az *az) Group() string {
+ return az.group
+}
+
+// Group returns the minus sign of number
+func (az *az) Minus() string {
+ return az.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'az' and handles both Whole and Real numbers based on 'v'
+func (az *az) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'az' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (az *az) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, az.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'az'
+func (az *az) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'az'
+// in accounting notation.
+func (az *az) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyNegativePrefix[j])
+ }
+
+ b = append(b, az.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'az'
+func (az *az) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'az'
+func (az *az) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'az'
+func (az *az) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'az'
+func (az *az) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, az.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'az'
+func (az *az) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'az'
+func (az *az) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'az'
+func (az *az) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'az'
+func (az *az) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := az.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/az/az_test.go b/vendor/github.com/go-playground/locales/az/az_test.go
new file mode 100644
index 000000000..3919018bb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az/az_test.go
@@ -0,0 +1,1120 @@
+package az
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl.go b/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl.go
new file mode 100644
index 000000000..5786cb53f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl.go
@@ -0,0 +1,643 @@
+package az_Cyrl
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type az_Cyrl struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'az_Cyrl' locale
+func New() locales.Translator {
+ return &az_Cyrl{
+ locale: "az_Cyrl",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "₼", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "јан", "фев", "мар", "апр", "май", "ијн", "ијл", "авг", "сен", "окт", "ној", "дек"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "јанвар", "феврал", "март", "апрел", "май", "ијун", "ијул", "август", "сентјабр", "октјабр", "нојабр", "декабр"},
+ daysAbbreviated: []string{"Б.", "Б.Е.", "Ч.А.", "Ч.", "Ҹ.А.", "Ҹ.", "Ш."},
+ daysNarrow: []string{"7", "1", "2", "3", "4", "5", "6"},
+ daysShort: []string{"Б.", "Б.Е.", "Ч.А.", "Ч.", "Ҹ.А.", "Ҹ.", "Ш."},
+ daysWide: []string{"базар", "базар ертәси", "чәршәнбә ахшамы", "чәршәнбә", "ҹүмә ахшамы", "ҹүмә", "шәнбә"},
+ periodsAbbreviated: []string{"АМ", "ПМ"},
+ periodsNarrow: []string{"а", "п"},
+ periodsWide: []string{"АМ", "ПМ"},
+ erasAbbreviated: []string{"е.ә.", "ј.е."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"ерамыздан әввәл", "јени ера"},
+ timezones: map[string]string{"WIT": "Şərqi İndoneziya Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "HEEG": "Şərqi Qrenlandiya Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "HEOG": "Qərbi Qrenlandiya Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "ECT": "Ekvador Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "HNPM": "Müqəddəs Pyer və Mikelon Standart Vaxtı", "HNNOMX": "Şimal-Qərbi Meksika Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "GYT": "Qayana Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "MST": "Şimali Dağlıq Amerika Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "AKST": "Alyaska Standart Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "IST": "Hindistan Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "AST": "Atlantik Standart Vaxt", "WEZ": "Qərbi Avropa Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "HNEG": "Şərqi Qrenlandiya Standart Vaxtı", "ART": "Argentina Standart Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "HNCU": "Kuba Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "VET": "Venesuela Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "JST": "Yaponiya Standart Vaxtı", "HNOG": "Qərbi Qrenlandiya Standart Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "SRT": "Surinam Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "HEPMX": "Meksika Sakit Okean Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "CHAST": "Çatham Standart Vaxtı", "HNPMX": "Meksika Sakit Okean Standart Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "CLT": "Çili Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "MYT": "Malayziya Vaxtı", "BOT": "Boliviya Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "MDT": "Şimali Dağlıq Amerika Yay Vaxtı", "ADT": "Atlantik Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "HEPM": "Müqəddəs Pyer və Mikelon Yay Vaxtı", "CLST": "Çili Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "∅∅∅": "Amazon Yay Vaxtı", "ChST": "Çamorro Vaxtı", "HECU": "Kuba Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "HENOMX": "Şimal-Qərbi Meksika Yay Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "BT": "Butan Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "CHADT": "Çatham Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (az *az_Cyrl) Locale() string {
+ return az.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'az_Cyrl'
+func (az *az_Cyrl) PluralsCardinal() []locales.PluralRule {
+ return az.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'az_Cyrl'
+func (az *az_Cyrl) PluralsOrdinal() []locales.PluralRule {
+ return az.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'az_Cyrl'
+func (az *az_Cyrl) PluralsRange() []locales.PluralRule {
+ return az.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'az_Cyrl'
+func (az *az_Cyrl) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'az_Cyrl'
+func (az *az_Cyrl) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ iMod1000 := i % 1000
+ iMod10 := i % 10
+ iMod100 := i % 100
+
+ if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
+ return locales.PluralRuleOne
+ } else if (iMod10 == 3 || iMod10 == 4) || (iMod1000 == 100 || iMod1000 == 200 || iMod1000 == 300 || iMod1000 == 400 || iMod1000 == 500 || iMod1000 == 600 || iMod1000 == 700 || iMod1000 == 800 || iMod1000 == 900) {
+ return locales.PluralRuleFew
+ } else if (i == 0) || (iMod10 == 6) || (iMod100 == 40 || iMod100 == 60 || iMod100 == 90) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'az_Cyrl'
+func (az *az_Cyrl) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := az.CardinalPluralRule(num1, v1)
+ end := az.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (az *az_Cyrl) MonthAbbreviated(month time.Month) string {
+ return az.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (az *az_Cyrl) MonthsAbbreviated() []string {
+ return az.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (az *az_Cyrl) MonthNarrow(month time.Month) string {
+ return az.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (az *az_Cyrl) MonthsNarrow() []string {
+ return az.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (az *az_Cyrl) MonthWide(month time.Month) string {
+ return az.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (az *az_Cyrl) MonthsWide() []string {
+ return az.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (az *az_Cyrl) WeekdayAbbreviated(weekday time.Weekday) string {
+ return az.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (az *az_Cyrl) WeekdaysAbbreviated() []string {
+ return az.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (az *az_Cyrl) WeekdayNarrow(weekday time.Weekday) string {
+ return az.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (az *az_Cyrl) WeekdaysNarrow() []string {
+ return az.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (az *az_Cyrl) WeekdayShort(weekday time.Weekday) string {
+ return az.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (az *az_Cyrl) WeekdaysShort() []string {
+ return az.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (az *az_Cyrl) WeekdayWide(weekday time.Weekday) string {
+ return az.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (az *az_Cyrl) WeekdaysWide() []string {
+ return az.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (az *az_Cyrl) Decimal() string {
+ return az.decimal
+}
+
+// Group returns the group of number
+func (az *az_Cyrl) Group() string {
+ return az.group
+}
+
+// Group returns the minus sign of number
+func (az *az_Cyrl) Minus() string {
+ return az.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'az_Cyrl' and handles both Whole and Real numbers based on 'v'
+func (az *az_Cyrl) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'az_Cyrl' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (az *az_Cyrl) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, az.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'az_Cyrl'
+func (az *az_Cyrl) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'az_Cyrl'
+// in accounting notation.
+func (az *az_Cyrl) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyNegativePrefix[j])
+ }
+
+ b = append(b, az.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, az.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'az_Cyrl'
+func (az *az_Cyrl) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := az.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl_test.go b/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl_test.go
new file mode 100644
index 000000000..b2523c57c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Cyrl/az_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package az_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ.go b/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ.go
new file mode 100644
index 000000000..eb9c67d35
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ.go
@@ -0,0 +1,643 @@
+package az_Cyrl_AZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type az_Cyrl_AZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'az_Cyrl_AZ' locale
+func New() locales.Translator {
+ return &az_Cyrl_AZ{
+ locale: "az_Cyrl_AZ",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "yan", "fev", "mar", "apr", "may", "iyn", "iyl", "avq", "sen", "okt", "noy", "dek"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "yanvar", "fevral", "mart", "aprel", "may", "iyun", "iyul", "avqust", "sentyabr", "oktyabr", "noyabr", "dekabr"},
+ daysAbbreviated: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysNarrow: []string{"7", "1", "2", "3", "4", "5", "6"},
+ daysShort: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysWide: []string{"bazar", "bazar ertəsi", "çərşənbə axşamı", "çərşənbə", "cümə axşamı", "cümə", "şənbə"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"e.ə.", "y.e."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"eramızdan əvvəl", "yeni era"},
+ timezones: map[string]string{"HAT": "Nyufaundlend Yay Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "MYT": "Malayziya Vaxtı", "HEOG": "Qərbi Qrenlandiya Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "AST": "Atlantik Standart Vaxt", "HADT": "Havay-Aleut Yay Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "HENOMX": "Şimal-Qərbi Meksika Yay Vaxtı", "MDT": "MDT", "CLST": "Çili Yay Vaxtı", "MST": "MST", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "CLT": "Çili Standart Vaxtı", "ChST": "Çamorro Vaxtı", "CHADT": "Çatham Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "IST": "Hindistan Vaxtı", "HEPM": "Müqəddəs Pyer və Mikelon Yay Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "HNPM": "Müqəddəs Pyer və Mikelon Standart Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "∅∅∅": "Azor Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "HNCU": "Kuba Standart Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "VET": "Venesuela Vaxtı", "HNNOMX": "Şimal-Qərbi Meksika Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "GYT": "Qayana Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "BOT": "Boliviya Vaxtı", "AKST": "Alyaska Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "HNPMX": "Meksika Sakit Okean Standart Vaxtı", "HEEG": "Şərqi Qrenlandiya Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "BT": "Butan Vaxtı", "ECT": "Ekvador Vaxtı", "HNOG": "Qərbi Qrenlandiya Standart Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "HECU": "Kuba Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "HNEG": "Şərqi Qrenlandiya Standart Vaxtı", "SRT": "Surinam Vaxtı", "ART": "Argentina Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "HEPMX": "Meksika Sakit Okean Yay Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (az *az_Cyrl_AZ) Locale() string {
+ return az.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) PluralsCardinal() []locales.PluralRule {
+ return az.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) PluralsOrdinal() []locales.PluralRule {
+ return az.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) PluralsRange() []locales.PluralRule {
+ return az.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ iMod1000 := i % 1000
+
+ if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
+ return locales.PluralRuleOne
+ } else if (iMod10 == 3 || iMod10 == 4) || (iMod1000 == 100 || iMod1000 == 200 || iMod1000 == 300 || iMod1000 == 400 || iMod1000 == 500 || iMod1000 == 600 || iMod1000 == 700 || iMod1000 == 800 || iMod1000 == 900) {
+ return locales.PluralRuleFew
+ } else if (i == 0) || (iMod10 == 6) || (iMod100 == 40 || iMod100 == 60 || iMod100 == 90) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := az.CardinalPluralRule(num1, v1)
+ end := az.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (az *az_Cyrl_AZ) MonthAbbreviated(month time.Month) string {
+ return az.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (az *az_Cyrl_AZ) MonthsAbbreviated() []string {
+ return az.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (az *az_Cyrl_AZ) MonthNarrow(month time.Month) string {
+ return az.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (az *az_Cyrl_AZ) MonthsNarrow() []string {
+ return az.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (az *az_Cyrl_AZ) MonthWide(month time.Month) string {
+ return az.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (az *az_Cyrl_AZ) MonthsWide() []string {
+ return az.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (az *az_Cyrl_AZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return az.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (az *az_Cyrl_AZ) WeekdaysAbbreviated() []string {
+ return az.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (az *az_Cyrl_AZ) WeekdayNarrow(weekday time.Weekday) string {
+ return az.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (az *az_Cyrl_AZ) WeekdaysNarrow() []string {
+ return az.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (az *az_Cyrl_AZ) WeekdayShort(weekday time.Weekday) string {
+ return az.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (az *az_Cyrl_AZ) WeekdaysShort() []string {
+ return az.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (az *az_Cyrl_AZ) WeekdayWide(weekday time.Weekday) string {
+ return az.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (az *az_Cyrl_AZ) WeekdaysWide() []string {
+ return az.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (az *az_Cyrl_AZ) Decimal() string {
+ return az.decimal
+}
+
+// Group returns the group of number
+func (az *az_Cyrl_AZ) Group() string {
+ return az.group
+}
+
+// Group returns the minus sign of number
+func (az *az_Cyrl_AZ) Minus() string {
+ return az.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'az_Cyrl_AZ' and handles both Whole and Real numbers based on 'v'
+func (az *az_Cyrl_AZ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'az_Cyrl_AZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (az *az_Cyrl_AZ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, az.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'az_Cyrl_AZ'
+// in accounting notation.
+func (az *az_Cyrl_AZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyNegativePrefix[j])
+ }
+
+ b = append(b, az.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, az.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'az_Cyrl_AZ'
+func (az *az_Cyrl_AZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := az.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ_test.go b/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ_test.go
new file mode 100644
index 000000000..0554ed62b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Cyrl_AZ/az_Cyrl_AZ_test.go
@@ -0,0 +1,1120 @@
+package az_Cyrl_AZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Cyrl_AZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/az_Latn/az_Latn.go b/vendor/github.com/go-playground/locales/az_Latn/az_Latn.go
new file mode 100644
index 000000000..1309df414
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Latn/az_Latn.go
@@ -0,0 +1,643 @@
+package az_Latn
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type az_Latn struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'az_Latn' locale
+func New() locales.Translator {
+ return &az_Latn{
+ locale: "az_Latn",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "yan", "fev", "mar", "apr", "may", "iyn", "iyl", "avq", "sen", "okt", "noy", "dek"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "yanvar", "fevral", "mart", "aprel", "may", "iyun", "iyul", "avqust", "sentyabr", "oktyabr", "noyabr", "dekabr"},
+ daysAbbreviated: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysNarrow: []string{"7", "1", "2", "3", "4", "5", "6"},
+ daysShort: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysWide: []string{"bazar", "bazar ertəsi", "çərşənbə axşamı", "çərşənbə", "cümə axşamı", "cümə", "şənbə"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"e.ə.", "y.e."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"eramızdan əvvəl", "yeni era"},
+ timezones: map[string]string{"WITA": "Mərkəzi İndoneziya Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "MDT": "MDT", "CLT": "Çili Standart Vaxtı", "OEZ": "Şərqi Avropa Standart Vaxtı", "BOT": "Boliviya Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "GYT": "Qayana Vaxtı", "HEOG": "Qərbi Qrenlandiya Yay Vaxtı", "∅∅∅": "Azor Yay Vaxtı", "ChST": "Çamorro Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "NZDT": "Yeni Zelandiya Yay Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "SRT": "Surinam Vaxtı", "HEEG": "Şərqi Qrenlandiya Yay Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "HEPMX": "Meksika Sakit Okean Yay Vaxtı", "BT": "Butan Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "ECT": "Ekvador Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "HNNOMX": "Şimal-Qərbi Meksika Standart Vaxtı", "OESZ": "Şərqi Avropa Yay Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "HNCU": "Kuba Standart Vaxtı", "HECU": "Kuba Yay Vaxtı", "HNEG": "Şərqi Qrenlandiya Standart Vaxtı", "HNPMX": "Meksika Sakit Okean Standart Vaxtı", "IST": "Hindistan Vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "HNPM": "Müqəddəs Pyer və Mikelon Standart Vaxtı", "HENOMX": "Şimal-Qərbi Meksika Yay Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "COST": "Kolumbiya Yay Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "MYT": "Malayziya Vaxtı", "MST": "MST", "ART": "Argentina Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "AKST": "Alyaska Standart Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "CLST": "Çili Yay Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "HEPM": "Müqəddəs Pyer və Mikelon Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "JST": "Yaponiya Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "VET": "Venesuela Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "ADT": "Atlantik Yay Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "SGT": "Sinqapur Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "HNOG": "Qərbi Qrenlandiya Standart Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "CHADT": "Çatham Yay Vaxtı", "AST": "Atlantik Standart Vaxt", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (az *az_Latn) Locale() string {
+ return az.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'az_Latn'
+func (az *az_Latn) PluralsCardinal() []locales.PluralRule {
+ return az.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'az_Latn'
+func (az *az_Latn) PluralsOrdinal() []locales.PluralRule {
+ return az.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'az_Latn'
+func (az *az_Latn) PluralsRange() []locales.PluralRule {
+ return az.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'az_Latn'
+func (az *az_Latn) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'az_Latn'
+func (az *az_Latn) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ iMod100 := i % 100
+ iMod1000 := i % 1000
+ iMod10 := i % 10
+
+ if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
+ return locales.PluralRuleOne
+ } else if (iMod10 == 3 || iMod10 == 4) || (iMod1000 == 100 || iMod1000 == 200 || iMod1000 == 300 || iMod1000 == 400 || iMod1000 == 500 || iMod1000 == 600 || iMod1000 == 700 || iMod1000 == 800 || iMod1000 == 900) {
+ return locales.PluralRuleFew
+ } else if (i == 0) || (iMod10 == 6) || (iMod100 == 40 || iMod100 == 60 || iMod100 == 90) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'az_Latn'
+func (az *az_Latn) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := az.CardinalPluralRule(num1, v1)
+ end := az.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (az *az_Latn) MonthAbbreviated(month time.Month) string {
+ return az.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (az *az_Latn) MonthsAbbreviated() []string {
+ return az.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (az *az_Latn) MonthNarrow(month time.Month) string {
+ return az.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (az *az_Latn) MonthsNarrow() []string {
+ return az.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (az *az_Latn) MonthWide(month time.Month) string {
+ return az.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (az *az_Latn) MonthsWide() []string {
+ return az.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (az *az_Latn) WeekdayAbbreviated(weekday time.Weekday) string {
+ return az.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (az *az_Latn) WeekdaysAbbreviated() []string {
+ return az.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (az *az_Latn) WeekdayNarrow(weekday time.Weekday) string {
+ return az.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (az *az_Latn) WeekdaysNarrow() []string {
+ return az.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (az *az_Latn) WeekdayShort(weekday time.Weekday) string {
+ return az.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (az *az_Latn) WeekdaysShort() []string {
+ return az.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (az *az_Latn) WeekdayWide(weekday time.Weekday) string {
+ return az.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (az *az_Latn) WeekdaysWide() []string {
+ return az.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (az *az_Latn) Decimal() string {
+ return az.decimal
+}
+
+// Group returns the group of number
+func (az *az_Latn) Group() string {
+ return az.group
+}
+
+// Group returns the minus sign of number
+func (az *az_Latn) Minus() string {
+ return az.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'az_Latn' and handles both Whole and Real numbers based on 'v'
+func (az *az_Latn) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'az_Latn' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (az *az_Latn) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, az.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'az_Latn'
+func (az *az_Latn) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'az_Latn'
+// in accounting notation.
+func (az *az_Latn) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyNegativePrefix[j])
+ }
+
+ b = append(b, az.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, az.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'az_Latn'
+func (az *az_Latn) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := az.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/az_Latn/az_Latn_test.go b/vendor/github.com/go-playground/locales/az_Latn/az_Latn_test.go
new file mode 100644
index 000000000..e30fbdebd
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Latn/az_Latn_test.go
@@ -0,0 +1,1120 @@
+package az_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ.go b/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ.go
new file mode 100644
index 000000000..c1f5df662
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ.go
@@ -0,0 +1,643 @@
+package az_Latn_AZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type az_Latn_AZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'az_Latn_AZ' locale
+func New() locales.Translator {
+ return &az_Latn_AZ{
+ locale: "az_Latn_AZ",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "yan", "fev", "mar", "apr", "may", "iyn", "iyl", "avq", "sen", "okt", "noy", "dek"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "yanvar", "fevral", "mart", "aprel", "may", "iyun", "iyul", "avqust", "sentyabr", "oktyabr", "noyabr", "dekabr"},
+ daysAbbreviated: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysNarrow: []string{"7", "1", "2", "3", "4", "5", "6"},
+ daysShort: []string{"B.", "B.E.", "Ç.A.", "Ç.", "C.A.", "C.", "Ş."},
+ daysWide: []string{"bazar", "bazar ertəsi", "çərşənbə axşamı", "çərşənbə", "cümə axşamı", "cümə", "şənbə"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"e.ə.", "y.e."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"eramızdan əvvəl", "yeni era"},
+ timezones: map[string]string{"OEZ": "Şərqi Avropa Standart Vaxtı", "GYT": "Qayana Vaxtı", "ChST": "Çamorro Vaxtı", "AWST": "Qərbi Avstraliya Standart Vaxtı", "WESZ": "Qərbi Avropa Yay Vaxtı", "MEZ": "Mərkəzi Avropa Standart Vaxtı", "HAT": "Nyufaundlend Yay Vaxtı", "EAT": "Şərqi Afrika Vaxtı", "ACWST": "Mərkəzi Qərbi Avstraliya Standart Vaxtı", "HKST": "Honq Konq Yay Vaxtı", "HECU": "Kuba Yay Vaxtı", "GMT": "Qrinviç Orta Vaxtı", "HNPMX": "Meksika Sakit Okean Standart Vaxtı", "WIB": "Qərbi İndoneziya Vaxtı", "HEOG": "Qərbi Qrenlandiya Yay Vaxtı", "MESZ": "Mərkəzi Avropa Yay Vaxtı", "HADT": "Havay-Aleut Yay Vaxtı", "SRT": "Surinam Vaxtı", "SAST": "Cənubi Afrika Vaxtı", "BOT": "Boliviya Vaxtı", "HAST": "Havay-Aleut Standart Vaxtı", "UYST": "Uruqvay Yay Vaxtı", "CDT": "Şimali Mərkəzi Amerika Yay Vaxtı", "ACDT": "Mərkəzi Avstraliya Yay Vaxtı", "IST": "Hindistan Vaxtı", "CLT": "Çili Standart Vaxtı", "COT": "Kolumbiya Standart Vaxtı", "HEPMX": "Meksika Sakit Okean Yay Vaxtı", "PDT": "Şimali Amerika Sakit Okean Yay Vaxtı", "AST": "Atlantik Standart Vaxt", "NZDT": "Yeni Zelandiya Yay Vaxtı", "HKT": "Honq Konq Standart Vaxtı", "LHST": "Lord Hau Standart Vaxtı", "WART": "Qərbi Argentina Standart Vaxtı", "ACST": "Mərkəzi Avstraliya Standart Vaxtı", "HEPM": "Müqəddəs Pyer və Mikelon Yay Vaxtı", "JST": "Yaponiya Standart Vaxtı", "UYT": "Uruqvay Standart Vaxtı", "GFT": "Fransız Qvianası Vaxtı", "HNOG": "Qərbi Qrenlandiya Standart Vaxtı", "VET": "Venesuela Vaxtı", "CLST": "Çili Yay Vaxtı", "HNCU": "Kuba Standart Vaxtı", "AEST": "Şərqi Avstraliya Standart Vaxtı", "ACWDT": "Mərkəzi Qərbi Avstraliya Yay Vaxtı", "HNPM": "Müqəddəs Pyer və Mikelon Standart Vaxtı", "ARST": "Argentina Yay Vaxtı", "AKST": "Alyaska Standart Vaxtı", "EDT": "Şimali Şərqi Amerika Yay Vaxtı", "TMST": "Türkmənistan Yay Vaxtı", "CHADT": "Çatham Yay Vaxtı", "ART": "Argentina Standart Vaxtı", "CHAST": "Çatham Standart Vaxtı", "EST": "Şimali Şərqi Amerika Standart Vaxtı", "TMT": "Türkmənistan Standart Vaxtı", "CAT": "Mərkəzi Afrika Vaxtı", "HEEG": "Şərqi Qrenlandiya Yay Vaxtı", "∅∅∅": "Azor Yay Vaxtı", "WARST": "Qərbi Argentina Yay Vaxtı", "WEZ": "Qərbi Avropa Standart Vaxtı", "BT": "Butan Vaxtı", "NZST": "Yeni Zelandiya Standart Vaxtı", "HNEG": "Şərqi Qrenlandiya Standart Vaxtı", "WIT": "Şərqi İndoneziya Vaxtı", "WAT": "Qərbi Afrika Standart Vaxtı", "PST": "Şimali Amerika Sakit Okean Standart Vaxtı", "AWDT": "Qərbi Avstraliya Yay Vaxtı", "AEDT": "Şərqi Avstraliya Yay Vaxtı", "WAST": "Qərbi Afrika Yay Vaxtı", "JDT": "Yaponiya Yay Vaxtı", "LHDT": "Lord Hau Yay vaxtı", "HNT": "Nyufaundlend Standart Vaxtı", "HNNOMX": "Şimal-Qərbi Meksika Standart Vaxtı", "MYT": "Malayziya Vaxtı", "ADT": "Atlantik Yay Vaxtı", "AKDT": "Alyaska Yay Vaxtı", "WITA": "Mərkəzi İndoneziya Vaxtı", "MDT": "MDT", "COST": "Kolumbiya Yay Vaxtı", "CST": "Şimali Mərkəzi Amerika Standart Vaxtı", "SGT": "Sinqapur Vaxtı", "ECT": "Ekvador Vaxtı", "HENOMX": "Şimal-Qərbi Meksika Yay Vaxtı", "MST": "MST", "OESZ": "Şərqi Avropa Yay Vaxtı"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (az *az_Latn_AZ) Locale() string {
+ return az.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'az_Latn_AZ'
+func (az *az_Latn_AZ) PluralsCardinal() []locales.PluralRule {
+ return az.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'az_Latn_AZ'
+func (az *az_Latn_AZ) PluralsOrdinal() []locales.PluralRule {
+ return az.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'az_Latn_AZ'
+func (az *az_Latn_AZ) PluralsRange() []locales.PluralRule {
+ return az.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ iMod1000 := i % 1000
+
+ if (iMod10 == 1 || iMod10 == 2 || iMod10 == 5 || iMod10 == 7 || iMod10 == 8) || (iMod100 == 20 || iMod100 == 50 || iMod100 == 70 || iMod100 == 80) {
+ return locales.PluralRuleOne
+ } else if (iMod10 == 3 || iMod10 == 4) || (iMod1000 == 100 || iMod1000 == 200 || iMod1000 == 300 || iMod1000 == 400 || iMod1000 == 500 || iMod1000 == 600 || iMod1000 == 700 || iMod1000 == 800 || iMod1000 == 900) {
+ return locales.PluralRuleFew
+ } else if (i == 0) || (iMod10 == 6) || (iMod100 == 40 || iMod100 == 60 || iMod100 == 90) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := az.CardinalPluralRule(num1, v1)
+ end := az.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (az *az_Latn_AZ) MonthAbbreviated(month time.Month) string {
+ return az.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (az *az_Latn_AZ) MonthsAbbreviated() []string {
+ return az.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (az *az_Latn_AZ) MonthNarrow(month time.Month) string {
+ return az.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (az *az_Latn_AZ) MonthsNarrow() []string {
+ return az.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (az *az_Latn_AZ) MonthWide(month time.Month) string {
+ return az.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (az *az_Latn_AZ) MonthsWide() []string {
+ return az.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (az *az_Latn_AZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return az.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (az *az_Latn_AZ) WeekdaysAbbreviated() []string {
+ return az.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (az *az_Latn_AZ) WeekdayNarrow(weekday time.Weekday) string {
+ return az.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (az *az_Latn_AZ) WeekdaysNarrow() []string {
+ return az.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (az *az_Latn_AZ) WeekdayShort(weekday time.Weekday) string {
+ return az.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (az *az_Latn_AZ) WeekdaysShort() []string {
+ return az.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (az *az_Latn_AZ) WeekdayWide(weekday time.Weekday) string {
+ return az.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (az *az_Latn_AZ) WeekdaysWide() []string {
+ return az.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (az *az_Latn_AZ) Decimal() string {
+ return az.decimal
+}
+
+// Group returns the group of number
+func (az *az_Latn_AZ) Group() string {
+ return az.group
+}
+
+// Group returns the minus sign of number
+func (az *az_Latn_AZ) Minus() string {
+ return az.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'az_Latn_AZ' and handles both Whole and Real numbers based on 'v'
+func (az *az_Latn_AZ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'az_Latn_AZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (az *az_Latn_AZ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, az.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, az.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'az_Latn_AZ'
+// in accounting notation.
+func (az *az_Latn_AZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := az.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, az.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, az.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyNegativePrefix[j])
+ }
+
+ b = append(b, az.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(az.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, az.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, az.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, az.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, az.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'az_Latn_AZ'
+func (az *az_Latn_AZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, az.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := az.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ_test.go b/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ_test.go
new file mode 100644
index 000000000..84bbb7987
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/az_Latn_AZ/az_Latn_AZ_test.go
@@ -0,0 +1,1120 @@
+package az_Latn_AZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "az_Latn_AZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bas/bas.go b/vendor/github.com/go-playground/locales/bas/bas.go
new file mode 100644
index 000000000..ba973bc34
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bas/bas.go
@@ -0,0 +1,590 @@
+package bas
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bas struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bas' locale
+func New() locales.Translator {
+ return &bas{
+ locale: "bas",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "kɔn", "mac", "mat", "mto", "mpu", "hil", "nje", "hik", "dip", "bio", "may", "liɓ"},
+ monthsNarrow: []string{"", "k", "m", "m", "m", "m", "h", "n", "h", "d", "b", "m", "l"},
+ monthsWide: []string{"", "Kɔndɔŋ", "Màcɛ̂l", "Màtùmb", "Màtop", "M̀puyɛ", "Hìlòndɛ̀", "Njèbà", "Hìkaŋ", "Dìpɔ̀s", "Bìòôm", "Màyɛsèp", "Lìbuy li ńyèe"},
+ daysAbbreviated: []string{"nɔy", "nja", "uum", "ŋge", "mbɔ", "kɔɔ", "jon"},
+ daysNarrow: []string{"n", "n", "u", "ŋ", "m", "k", "j"},
+ daysWide: []string{"ŋgwà nɔ̂y", "ŋgwà njaŋgumba", "ŋgwà ûm", "ŋgwà ŋgê", "ŋgwà mbɔk", "ŋgwà kɔɔ", "ŋgwà jôn"},
+ periodsAbbreviated: []string{"I bikɛ̂glà", "I ɓugajɔp"},
+ periodsWide: []string{"I bikɛ̂glà", "I ɓugajɔp"},
+ erasAbbreviated: []string{"b.Y.K", "m.Y.K"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"bisū bi Yesù Krǐstò", "i mbūs Yesù Krǐstò"},
+ timezones: map[string]string{"SGT": "SGT", "VET": "VET", "PDT": "PDT", "ADT": "ADT", "HNT": "HNT", "OEZ": "OEZ", "ACWDT": "ACWDT", "HKST": "HKST", "SRT": "SRT", "HADT": "HADT", "UYT": "UYT", "AEDT": "AEDT", "ECT": "ECT", "ACDT": "ACDT", "TMT": "TMT", "TMST": "TMST", "GYT": "GYT", "HNOG": "HNOG", "EAT": "EAT", "OESZ": "OESZ", "HECU": "HECU", "AWDT": "AWDT", "WEZ": "WEZ", "BOT": "BOT", "ACST": "ACST", "MESZ": "MESZ", "HNPM": "HNPM", "COT": "COT", "ART": "ART", "CST": "CST", "AEST": "AEST", "BT": "BT", "EDT": "EDT", "LHDT": "LHDT", "HEPM": "HEPM", "HENOMX": "HENOMX", "MST": "MST", "CHADT": "CHADT", "AKDT": "AKDT", "HEOG": "HEOG", "MEZ": "MEZ", "∅∅∅": "∅∅∅", "HNNOMX": "HNNOMX", "MDT": "MDT", "AST": "AST", "WIB": "WIB", "NZDT": "NZDT", "AKST": "AKST", "EST": "EST", "LHST": "LHST", "HAT": "HAT", "HEEG": "HEEG", "IST": "IST", "WARST": "WARST", "HNCU": "HNCU", "HNPMX": "HNPMX", "GFT": "GFT", "CLST": "CLST", "ChST": "ChST", "PST": "PST", "WESZ": "WESZ", "ARST": "ARST", "GMT": "GMT", "CDT": "CDT", "HEPMX": "HEPMX", "WAST": "WAST", "WIT": "WIT", "HAST": "HAST", "SAST": "SAST", "MYT": "MYT", "JDT": "JDT", "HKT": "HKT", "WITA": "WITA", "CLT": "CLT", "WAT": "WAT", "NZST": "NZST", "ACWST": "ACWST", "WART": "WART", "CHAST": "CHAST", "AWST": "AWST", "JST": "JST", "HNEG": "HNEG", "CAT": "CAT", "COST": "COST", "UYST": "UYST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bas *bas) Locale() string {
+ return bas.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bas'
+func (bas *bas) PluralsCardinal() []locales.PluralRule {
+ return bas.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bas'
+func (bas *bas) PluralsOrdinal() []locales.PluralRule {
+ return bas.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bas'
+func (bas *bas) PluralsRange() []locales.PluralRule {
+ return bas.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bas'
+func (bas *bas) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bas'
+func (bas *bas) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bas'
+func (bas *bas) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bas *bas) MonthAbbreviated(month time.Month) string {
+ return bas.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bas *bas) MonthsAbbreviated() []string {
+ return bas.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bas *bas) MonthNarrow(month time.Month) string {
+ return bas.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bas *bas) MonthsNarrow() []string {
+ return bas.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bas *bas) MonthWide(month time.Month) string {
+ return bas.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bas *bas) MonthsWide() []string {
+ return bas.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bas *bas) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bas.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bas *bas) WeekdaysAbbreviated() []string {
+ return bas.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bas *bas) WeekdayNarrow(weekday time.Weekday) string {
+ return bas.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bas *bas) WeekdaysNarrow() []string {
+ return bas.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bas *bas) WeekdayShort(weekday time.Weekday) string {
+ return bas.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bas *bas) WeekdaysShort() []string {
+ return bas.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bas *bas) WeekdayWide(weekday time.Weekday) string {
+ return bas.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bas *bas) WeekdaysWide() []string {
+ return bas.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bas *bas) Decimal() string {
+ return bas.decimal
+}
+
+// Group returns the group of number
+func (bas *bas) Group() string {
+ return bas.group
+}
+
+// Group returns the minus sign of number
+func (bas *bas) Minus() string {
+ return bas.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bas' and handles both Whole and Real numbers based on 'v'
+func (bas *bas) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bas' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bas *bas) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bas.percentSuffix...)
+
+ b = append(b, bas.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bas'
+func (bas *bas) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bas.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bas.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bas.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bas'
+// in accounting notation.
+func (bas *bas) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bas.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bas.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bas.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bas.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bas.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bas'
+func (bas *bas) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bas'
+func (bas *bas) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bas'
+func (bas *bas) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bas'
+func (bas *bas) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bas.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bas'
+func (bas *bas) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bas'
+func (bas *bas) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bas'
+func (bas *bas) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bas'
+func (bas *bas) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bas.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bas/bas_test.go b/vendor/github.com/go-playground/locales/bas/bas_test.go
new file mode 100644
index 000000000..1b9b2b87a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bas/bas_test.go
@@ -0,0 +1,1120 @@
+package bas
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bas"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bas_CM/bas_CM.go b/vendor/github.com/go-playground/locales/bas_CM/bas_CM.go
new file mode 100644
index 000000000..293d67925
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bas_CM/bas_CM.go
@@ -0,0 +1,590 @@
+package bas_CM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bas_CM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bas_CM' locale
+func New() locales.Translator {
+ return &bas_CM{
+ locale: "bas_CM",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "kɔn", "mac", "mat", "mto", "mpu", "hil", "nje", "hik", "dip", "bio", "may", "liɓ"},
+ monthsNarrow: []string{"", "k", "m", "m", "m", "m", "h", "n", "h", "d", "b", "m", "l"},
+ monthsWide: []string{"", "Kɔndɔŋ", "Màcɛ̂l", "Màtùmb", "Màtop", "M̀puyɛ", "Hìlòndɛ̀", "Njèbà", "Hìkaŋ", "Dìpɔ̀s", "Bìòôm", "Màyɛsèp", "Lìbuy li ńyèe"},
+ daysAbbreviated: []string{"nɔy", "nja", "uum", "ŋge", "mbɔ", "kɔɔ", "jon"},
+ daysNarrow: []string{"n", "n", "u", "ŋ", "m", "k", "j"},
+ daysWide: []string{"ŋgwà nɔ̂y", "ŋgwà njaŋgumba", "ŋgwà ûm", "ŋgwà ŋgê", "ŋgwà mbɔk", "ŋgwà kɔɔ", "ŋgwà jôn"},
+ periodsAbbreviated: []string{"I bikɛ̂glà", "I ɓugajɔp"},
+ periodsWide: []string{"I bikɛ̂glà", "I ɓugajɔp"},
+ erasAbbreviated: []string{"b.Y.K", "m.Y.K"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"bisū bi Yesù Krǐstò", "i mbūs Yesù Krǐstò"},
+ timezones: map[string]string{"WITA": "WITA", "HAT": "HAT", "TMT": "TMT", "EAT": "EAT", "UYST": "UYST", "HECU": "HECU", "MYT": "MYT", "AKDT": "AKDT", "EST": "EST", "HNNOMX": "HNNOMX", "CLST": "CLST", "CST": "CST", "AEST": "AEST", "HNCU": "HNCU", "WESZ": "WESZ", "ACWST": "ACWST", "ACWDT": "ACWDT", "HEOG": "HEOG", "HKT": "HKT", "TMST": "TMST", "CHADT": "CHADT", "JST": "JST", "OEZ": "OEZ", "SGT": "SGT", "HNEG": "HNEG", "LHDT": "LHDT", "VET": "VET", "MDT": "MDT", "ARST": "ARST", "BOT": "BOT", "HENOMX": "HENOMX", "COT": "COT", "UYT": "UYT", "PDT": "PDT", "WEZ": "WEZ", "SAST": "SAST", "IST": "IST", "PST": "PST", "AKST": "AKST", "COST": "COST", "AWDT": "AWDT", "GFT": "GFT", "CDT": "CDT", "AST": "AST", "NZST": "NZST", "ACDT": "ACDT", "ART": "ART", "HAST": "HAST", "AEDT": "AEDT", "HNPMX": "HNPMX", "NZDT": "NZDT", "ECT": "ECT", "ACST": "ACST", "MEZ": "MEZ", "WART": "WART", "OESZ": "OESZ", "ChST": "ChST", "HNOG": "HNOG", "HKST": "HKST", "MST": "MST", "CHAST": "CHAST", "WAST": "WAST", "WAT": "WAT", "WARST": "WARST", "HEPM": "HEPM", "CLT": "CLT", "HADT": "HADT", "GYT": "GYT", "WIB": "WIB", "MESZ": "MESZ", "HNT": "HNT", "SRT": "SRT", "HEPMX": "HEPMX", "HNPM": "HNPM", "CAT": "CAT", "ADT": "ADT", "JDT": "JDT", "BT": "BT", "AWST": "AWST", "HEEG": "HEEG", "EDT": "EDT", "∅∅∅": "∅∅∅", "LHST": "LHST", "WIT": "WIT", "GMT": "GMT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bas *bas_CM) Locale() string {
+ return bas.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bas_CM'
+func (bas *bas_CM) PluralsCardinal() []locales.PluralRule {
+ return bas.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bas_CM'
+func (bas *bas_CM) PluralsOrdinal() []locales.PluralRule {
+ return bas.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bas_CM'
+func (bas *bas_CM) PluralsRange() []locales.PluralRule {
+ return bas.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bas_CM'
+func (bas *bas_CM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bas_CM'
+func (bas *bas_CM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bas_CM'
+func (bas *bas_CM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bas *bas_CM) MonthAbbreviated(month time.Month) string {
+ return bas.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bas *bas_CM) MonthsAbbreviated() []string {
+ return bas.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bas *bas_CM) MonthNarrow(month time.Month) string {
+ return bas.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bas *bas_CM) MonthsNarrow() []string {
+ return bas.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bas *bas_CM) MonthWide(month time.Month) string {
+ return bas.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bas *bas_CM) MonthsWide() []string {
+ return bas.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bas *bas_CM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bas.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bas *bas_CM) WeekdaysAbbreviated() []string {
+ return bas.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bas *bas_CM) WeekdayNarrow(weekday time.Weekday) string {
+ return bas.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bas *bas_CM) WeekdaysNarrow() []string {
+ return bas.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bas *bas_CM) WeekdayShort(weekday time.Weekday) string {
+ return bas.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bas *bas_CM) WeekdaysShort() []string {
+ return bas.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bas *bas_CM) WeekdayWide(weekday time.Weekday) string {
+ return bas.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bas *bas_CM) WeekdaysWide() []string {
+ return bas.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bas *bas_CM) Decimal() string {
+ return bas.decimal
+}
+
+// Group returns the group of number
+func (bas *bas_CM) Group() string {
+ return bas.group
+}
+
+// Group returns the minus sign of number
+func (bas *bas_CM) Minus() string {
+ return bas.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bas_CM' and handles both Whole and Real numbers based on 'v'
+func (bas *bas_CM) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bas_CM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bas *bas_CM) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bas.percentSuffix...)
+
+ b = append(b, bas.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bas_CM'
+func (bas *bas_CM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bas.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bas.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bas.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bas.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bas_CM'
+// in accounting notation.
+func (bas *bas_CM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bas.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bas.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bas.group) - 1; j >= 0; j-- {
+ b = append(b, bas.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bas.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bas.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bas.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bas.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bas.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bas.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bas_CM'
+func (bas *bas_CM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bas.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bas.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bas_CM/bas_CM_test.go b/vendor/github.com/go-playground/locales/bas_CM/bas_CM_test.go
new file mode 100644
index 000000000..cda7c58a9
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bas_CM/bas_CM_test.go
@@ -0,0 +1,1120 @@
+package bas_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bas_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/be/be.go b/vendor/github.com/go-playground/locales/be/be.go
new file mode 100644
index 000000000..df5117087
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/be/be.go
@@ -0,0 +1,673 @@
+package be
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type be struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'be' locale
+func New() locales.Translator {
+ return &be{
+ locale: "be",
+ pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{4, 6},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "Br", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "₽", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "сту", "лют", "сак", "кра", "мая", "чэр", "ліп", "жні", "вер", "кас", "ліс", "сне"},
+ monthsNarrow: []string{"", "с", "л", "с", "к", "м", "ч", "л", "ж", "в", "к", "л", "с"},
+ monthsWide: []string{"", "студзеня", "лютага", "сакавіка", "красавіка", "мая", "чэрвеня", "ліпеня", "жніўня", "верасня", "кастрычніка", "лістапада", "снежня"},
+ daysAbbreviated: []string{"нд", "пн", "аў", "ср", "чц", "пт", "сб"},
+ daysNarrow: []string{"н", "п", "а", "с", "ч", "п", "с"},
+ daysShort: []string{"нд", "пн", "аў", "ср", "чц", "пт", "сб"},
+ daysWide: []string{"нядзеля", "панядзелак", "аўторак", "серада", "чацвер", "пятніца", "субота"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"am", "pm"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"да н.э.", "н.э."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"да нараджэння Хрыстова", "ад нараджэння Хрыстова"},
+ timezones: map[string]string{"AEST": "Стандартны час усходняй Аўстраліі", "NZST": "Стандартны час Новай Зеландыі", "AKST": "Стандартны час Аляскі", "WARST": "Летні час Заходняй Аргенціны", "HENOMX": "Паўночна-заходні мексіканскі летні час", "PST": "Ціхаакіянскі стандартны час", "ACDT": "Летні час цэнтральнай Аўстраліі", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "HNNOMX": "Паўночна-заходні мексіканскі стандартны час", "TMST": "Летні час Туркменістана", "JST": "Стандартны час Японіі", "HKST": "Летні час Ганконга", "IST": "Час Індыі", "CHADT": "Летні час Чатэма", "NZDT": "Летні час Новай Зеландыі", "EDT": "Паўночнаамерыканскі ўсходні летні час", "ChST": "Час Чамора", "CHAST": "Стандартны час Чатэма", "CDT": "Паўночнаамерыканскі цэнтральны летні час", "GFT": "Час Французскай Гвіяны", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "MESZ": "Цэнтральнаеўрапейскі летні час", "MST": "MST", "OEZ": "Усходнееўрапейскі стандартны час", "HNCU": "Стандартны час Кубы", "WESZ": "Заходнееўрапейскі летні час", "HNEG": "Стандартны час Усходняй Грэнландыі", "HAT": "Ньюфаўндлендскі летні час", "AWST": "Стандартны час заходняй Аўстраліі", "ADT": "Атлантычны летні час", "JDT": "Летні час Японіі", "ACST": "Стандартны час цэнтральнай Аўстраліі", "ART": "Аргенцінскі стандартны час", "PDT": "Ціхаакіянскі летні час", "SAST": "Паўднёваафрыканскі час", "ECT": "Эквадорскі час", "MDT": "MDT", "HAST": "Гавайска-Алеуцкі стандартны час", "HECU": "Летні час Кубы", "HNPM": "Стандартны час Сен-П’ер і Мікелон", "CAT": "Цэнтральнаафрыканскі час", "BT": "Час Бутана", "WAT": "Заходнеафрыканскі стандартны час", "MYT": "Час Малайзіі", "WIT": "Усходнеінданезійскі час", "HADT": "Гавайска-Алеуцкі летні час", "HNPMX": "Мексіканскі ціхаакіянскі стандатны час", "COST": "Калумбійскі летні час", "GMT": "Час па Грынвічы", "AWDT": "Летні час заходняй Аўстраліі", "HEPMX": "Мексіканскі ціхаакіянскі летні час", "WIB": "Заходнеінданезійскі час", "LHDT": "Летні час Лорд-Хау", "WART": "Стандартны час Заходняй Аргенціны", "CLT": "Чылійскі стандартны час", "ARST": "Аргенцінскі летні час", "GYT": "Час Гаяны", "WEZ": "Заходнееўрапейскі стандартны час", "BOT": "Балівійскі час", "SGT": "Сінгапурскі час", "HEEG": "Летні час Усходняй Грэнландыі", "HEOG": "Летні час Заходняй Грэнландыі", "HNT": "Ньюфаўндлендскі стандартны час", "UYT": "Уругвайскі стандартны час", "WAST": "Заходнеафрыканскі летні час", "HKT": "Стандартны час Ганконга", "TMT": "Стандартны час Туркменістана", "AEDT": "Летні час усходняй Аўстраліі", "AKDT": "Летні час Аляскі", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "WITA": "Цэнтральнаінданезійскі час", "EAT": "Усходнеафрыканскі час", "CLST": "Чылійскі летні час", "LHST": "Стандартны час Лорд-Хау", "∅∅∅": "Перуанскі летні час", "HNOG": "Стандартны час Заходняй Грэнландыі", "OESZ": "Усходнееўрапейскі летні час", "COT": "Калумбійскі стандартны час", "UYST": "Уругвайскі летні час", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "AST": "Атлантычны стандартны час", "VET": "Венесуэльскі час", "HEPM": "Стандартны летні час Сен-П’ер і Мікелон", "SRT": "Час Сурынама"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (be *be) Locale() string {
+ return be.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'be'
+func (be *be) PluralsCardinal() []locales.PluralRule {
+ return be.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'be'
+func (be *be) PluralsOrdinal() []locales.PluralRule {
+ return be.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'be'
+func (be *be) PluralsRange() []locales.PluralRule {
+ return be.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'be'
+func (be *be) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
+
+ if nMod10 == 1 && nMod100 != 11 {
+ return locales.PluralRuleOne
+ } else if nMod10 >= 2 && nMod10 <= 4 && (nMod100 < 12 || nMod100 > 14) {
+ return locales.PluralRuleFew
+ } else if (nMod10 == 0) || (nMod10 >= 5 && nMod10 <= 9) || (nMod100 >= 11 && nMod100 <= 14) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'be'
+func (be *be) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
+
+ if (nMod10 == 2 || nMod10 == 3) && (nMod100 != 12 && nMod100 != 13) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'be'
+func (be *be) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := be.CardinalPluralRule(num1, v1)
+ end := be.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (be *be) MonthAbbreviated(month time.Month) string {
+ return be.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (be *be) MonthsAbbreviated() []string {
+ return be.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (be *be) MonthNarrow(month time.Month) string {
+ return be.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (be *be) MonthsNarrow() []string {
+ return be.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (be *be) MonthWide(month time.Month) string {
+ return be.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (be *be) MonthsWide() []string {
+ return be.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (be *be) WeekdayAbbreviated(weekday time.Weekday) string {
+ return be.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (be *be) WeekdaysAbbreviated() []string {
+ return be.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (be *be) WeekdayNarrow(weekday time.Weekday) string {
+ return be.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (be *be) WeekdaysNarrow() []string {
+ return be.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (be *be) WeekdayShort(weekday time.Weekday) string {
+ return be.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (be *be) WeekdaysShort() []string {
+ return be.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (be *be) WeekdayWide(weekday time.Weekday) string {
+ return be.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (be *be) WeekdaysWide() []string {
+ return be.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (be *be) Decimal() string {
+ return be.decimal
+}
+
+// Group returns the group of number
+func (be *be) Group() string {
+ return be.group
+}
+
+// Group returns the minus sign of number
+func (be *be) Minus() string {
+ return be.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'be' and handles both Whole and Real numbers based on 'v'
+func (be *be) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'be' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (be *be) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, be.percentSuffix...)
+
+ b = append(b, be.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'be'
+func (be *be) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := be.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, be.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, be.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'be'
+// in accounting notation.
+func (be *be) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := be.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, be.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, be.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, be.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, be.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'be'
+func (be *be) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'be'
+func (be *be) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'be'
+func (be *be) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, be.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'be'
+func (be *be) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, be.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, be.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'be'
+func (be *be) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'be'
+func (be *be) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'be'
+func (be *be) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'be'
+func (be *be) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := be.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/be/be_test.go b/vendor/github.com/go-playground/locales/be/be_test.go
new file mode 100644
index 000000000..d34710dff
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/be/be_test.go
@@ -0,0 +1,1120 @@
+package be
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "be"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/be_BY/be_BY.go b/vendor/github.com/go-playground/locales/be_BY/be_BY.go
new file mode 100644
index 000000000..5b9774974
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/be_BY/be_BY.go
@@ -0,0 +1,673 @@
+package be_BY
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type be_BY struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'be_BY' locale
+func New() locales.Translator {
+ return &be_BY{
+ locale: "be_BY",
+ pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{4, 6},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "сту", "лют", "сак", "кра", "мая", "чэр", "ліп", "жні", "вер", "кас", "ліс", "сне"},
+ monthsNarrow: []string{"", "с", "л", "с", "к", "м", "ч", "л", "ж", "в", "к", "л", "с"},
+ monthsWide: []string{"", "студзеня", "лютага", "сакавіка", "красавіка", "мая", "чэрвеня", "ліпеня", "жніўня", "верасня", "кастрычніка", "лістапада", "снежня"},
+ daysAbbreviated: []string{"нд", "пн", "аў", "ср", "чц", "пт", "сб"},
+ daysNarrow: []string{"н", "п", "а", "с", "ч", "п", "с"},
+ daysShort: []string{"нд", "пн", "аў", "ср", "чц", "пт", "сб"},
+ daysWide: []string{"нядзеля", "панядзелак", "аўторак", "серада", "чацвер", "пятніца", "субота"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"am", "pm"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"да н.э.", "н.э."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"да нараджэння Хрыстова", "ад нараджэння Хрыстова"},
+ timezones: map[string]string{"IST": "Час Індыі", "WARST": "Летні час Заходняй Аргенціны", "PDT": "Ціхаакіянскі летні час", "HENOMX": "Паўночна-заходні мексіканскі летні час", "SRT": "Час Сурынама", "OESZ": "Усходнееўрапейскі летні час", "AEDT": "Летні час усходняй Аўстраліі", "LHDT": "Летні час Лорд-Хау", "MST": "MST", "TMST": "Летні час Туркменістана", "AWDT": "Летні час заходняй Аўстраліі", "COST": "Калумбійскі летні час", "AWST": "Стандартны час заходняй Аўстраліі", "AKDT": "Летні час Аляскі", "WART": "Стандартны час Заходняй Аргенціны", "OEZ": "Усходнееўрапейскі стандартны час", "ARST": "Аргенцінскі летні час", "COT": "Калумбійскі стандартны час", "NZST": "Стандартны час Новай Зеландыі", "EDT": "Паўночнаамерыканскі ўсходні летні час", "ACDT": "Летні час цэнтральнай Аўстраліі", "UYT": "Уругвайскі стандартны час", "UYST": "Уругвайскі летні час", "HNCU": "Стандартны час Кубы", "NZDT": "Летні час Новай Зеландыі", "HEEG": "Летні час Усходняй Грэнландыі", "WIT": "Усходнеінданезійскі час", "CHAST": "Стандартны час Чатэма", "CHADT": "Летні час Чатэма", "EST": "Паўночнаамерыканскі ўсходні стандартны час", "LHST": "Стандартны час Лорд-Хау", "HNPMX": "Мексіканскі ціхаакіянскі стандатны час", "WESZ": "Заходнееўрапейскі летні час", "ACST": "Стандартны час цэнтральнай Аўстраліі", "HAT": "Ньюфаўндлендскі летні час", "MDT": "MDT", "CST": "Паўночнаамерыканскі цэнтральны стандартны час", "HEPM": "Стандартны летні час Сен-П’ер і Мікелон", "AEST": "Стандартны час усходняй Аўстраліі", "HEPMX": "Мексіканскі ціхаакіянскі летні час", "SAST": "Паўднёваафрыканскі час", "ECT": "Эквадорскі час", "∅∅∅": "Летні час Азорскіх астравоў", "VET": "Венесуэльскі час", "EAT": "Усходнеафрыканскі час", "ART": "Аргенцінскі стандартны час", "WITA": "Цэнтральнаінданезійскі час", "ACWST": "Заходні стандартны час Цэнтральнай Аўстраліі", "HNEG": "Стандартны час Усходняй Грэнландыі", "HKT": "Стандартны час Ганконга", "HNT": "Ньюфаўндлендскі стандартны час", "PST": "Ціхаакіянскі стандартны час", "ADT": "Атлантычны летні час", "WAT": "Заходнеафрыканскі стандартны час", "WEZ": "Заходнееўрапейскі стандартны час", "ACWDT": "Заходні летні час Цэнтральнай Аўстраліі", "TMT": "Стандартны час Туркменістана", "CLT": "Чылійскі стандартны час", "GYT": "Час Гаяны", "MYT": "Час Малайзіі", "SGT": "Сінгапурскі час", "HEOG": "Летні час Заходняй Грэнландыі", "MEZ": "Цэнтральнаеўрапейскі стандартны час", "ChST": "Час Чамора", "GFT": "Час Французскай Гвіяны", "WAST": "Заходнеафрыканскі летні час", "WIB": "Заходнеінданезійскі час", "BOT": "Балівійскі час", "HNNOMX": "Паўночна-заходні мексіканскі стандартны час", "CAT": "Цэнтральнаафрыканскі час", "CLST": "Чылійскі летні час", "AST": "Атлантычны стандартны час", "HECU": "Летні час Кубы", "BT": "Час Бутана", "AKST": "Стандартны час Аляскі", "MESZ": "Цэнтральнаеўрапейскі летні час", "HKST": "Летні час Ганконга", "HADT": "Гавайска-Алеуцкі летні час", "GMT": "Час па Грынвічы", "JST": "Стандартны час Японіі", "JDT": "Летні час Японіі", "HNOG": "Стандартны час Заходняй Грэнландыі", "HNPM": "Стандартны час Сен-П’ер і Мікелон", "HAST": "Гавайска-Алеуцкі стандартны час", "CDT": "Паўночнаамерыканскі цэнтральны летні час"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (be *be_BY) Locale() string {
+ return be.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'be_BY'
+func (be *be_BY) PluralsCardinal() []locales.PluralRule {
+ return be.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'be_BY'
+func (be *be_BY) PluralsOrdinal() []locales.PluralRule {
+ return be.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'be_BY'
+func (be *be_BY) PluralsRange() []locales.PluralRule {
+ return be.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'be_BY'
+func (be *be_BY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
+
+ if nMod10 == 1 && nMod100 != 11 {
+ return locales.PluralRuleOne
+ } else if nMod10 >= 2 && nMod10 <= 4 && (nMod100 < 12 || nMod100 > 14) {
+ return locales.PluralRuleFew
+ } else if (nMod10 == 0) || (nMod10 >= 5 && nMod10 <= 9) || (nMod100 >= 11 && nMod100 <= 14) {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'be_BY'
+func (be *be_BY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
+
+ if (nMod10 == 2 || nMod10 == 3) && (nMod100 != 12 && nMod100 != 13) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'be_BY'
+func (be *be_BY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := be.CardinalPluralRule(num1, v1)
+ end := be.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (be *be_BY) MonthAbbreviated(month time.Month) string {
+ return be.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (be *be_BY) MonthsAbbreviated() []string {
+ return be.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (be *be_BY) MonthNarrow(month time.Month) string {
+ return be.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (be *be_BY) MonthsNarrow() []string {
+ return be.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (be *be_BY) MonthWide(month time.Month) string {
+ return be.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (be *be_BY) MonthsWide() []string {
+ return be.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (be *be_BY) WeekdayAbbreviated(weekday time.Weekday) string {
+ return be.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (be *be_BY) WeekdaysAbbreviated() []string {
+ return be.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (be *be_BY) WeekdayNarrow(weekday time.Weekday) string {
+ return be.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (be *be_BY) WeekdaysNarrow() []string {
+ return be.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (be *be_BY) WeekdayShort(weekday time.Weekday) string {
+ return be.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (be *be_BY) WeekdaysShort() []string {
+ return be.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (be *be_BY) WeekdayWide(weekday time.Weekday) string {
+ return be.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (be *be_BY) WeekdaysWide() []string {
+ return be.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (be *be_BY) Decimal() string {
+ return be.decimal
+}
+
+// Group returns the group of number
+func (be *be_BY) Group() string {
+ return be.group
+}
+
+// Group returns the minus sign of number
+func (be *be_BY) Minus() string {
+ return be.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'be_BY' and handles both Whole and Real numbers based on 'v'
+func (be *be_BY) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'be_BY' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (be *be_BY) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, be.percentSuffix...)
+
+ b = append(b, be.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'be_BY'
+func (be *be_BY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := be.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, be.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, be.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, be.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'be_BY'
+// in accounting notation.
+func (be *be_BY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := be.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, be.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(be.group) - 1; j >= 0; j-- {
+ b = append(b, be.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, be.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, be.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, be.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, be.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'be_BY'
+func (be *be_BY) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'be_BY'
+func (be *be_BY) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'be_BY'
+func (be *be_BY) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, be.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'be_BY'
+func (be *be_BY) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, be.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, be.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'be_BY'
+func (be *be_BY) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'be_BY'
+func (be *be_BY) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'be_BY'
+func (be *be_BY) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'be_BY'
+func (be *be_BY) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, be.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := be.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/be_BY/be_BY_test.go b/vendor/github.com/go-playground/locales/be_BY/be_BY_test.go
new file mode 100644
index 000000000..e93f11a2d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/be_BY/be_BY_test.go
@@ -0,0 +1,1120 @@
+package be_BY
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "be_BY"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bem/bem.go b/vendor/github.com/go-playground/locales/bem/bem.go
new file mode 100644
index 000000000..fc79c3e33
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bem/bem.go
@@ -0,0 +1,576 @@
+package bem
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bem struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bem' locale
+func New() locales.Translator {
+ return &bem{
+ locale: "bem",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "K", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Jan", "Feb", "Mac", "Epr", "Mei", "Jun", "Jul", "Oga", "Sep", "Okt", "Nov", "Dis"},
+ monthsNarrow: []string{"", "J", "F", "M", "E", "M", "J", "J", "O", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januari", "Februari", "Machi", "Epreo", "Mei", "Juni", "Julai", "Ogasti", "Septemba", "Oktoba", "Novemba", "Disemba"},
+ daysWide: []string{"Pa Mulungu", "Palichimo", "Palichibuli", "Palichitatu", "Palichine", "Palichisano", "Pachibelushi"},
+ periodsAbbreviated: []string{"uluchelo", "akasuba"},
+ periodsWide: []string{"uluchelo", "akasuba"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Before Yesu", "After Yesu"},
+ timezones: map[string]string{"HADT": "HADT", "HECU": "HECU", "AWST": "AWST", "AWDT": "AWDT", "MDT": "MDT", "WIB": "WIB", "COST": "COST", "HAST": "HAST", "EST": "EST", "WART": "WART", "SGT": "SGT", "ACWDT": "ACWDT", "NZDT": "NZDT", "VET": "VET", "WAT": "WAT", "JST": "JST", "JDT": "JDT", "MEZ": "MEZ", "HENOMX": "HENOMX", "HNCU": "HNCU", "WEZ": "WEZ", "CHAST": "CHAST", "HEPMX": "HEPMX", "HEPM": "HEPM", "CLT": "CLT", "GMT": "GMT", "MST": "MST", "COT": "COT", "CHADT": "CHADT", "ACST": "ACST", "OESZ": "OESZ", "WAST": "WAST", "BOT": "BOT", "HEOG": "HEOG", "WARST": "WARST", "EAT": "EAT", "CDT": "CDT", "HNT": "HNT", "UYST": "UYST", "PDT": "PDT", "AKST": "AKST", "ACDT": "ACDT", "HNNOMX": "HNNOMX", "SRT": "SRT", "WESZ": "WESZ", "SAST": "SAST", "ARST": "ARST", "HNPM": "HNPM", "CLST": "CLST", "TMT": "TMT", "HNPMX": "HNPMX", "PST": "PST", "MESZ": "MESZ", "WITA": "WITA", "CAT": "CAT", "UYT": "UYT", "BT": "BT", "LHDT": "LHDT", "ART": "ART", "AEST": "AEST", "AST": "AST", "GFT": "GFT", "ECT": "ECT", "ACWST": "ACWST", "HEEG": "HEEG", "HNOG": "HNOG", "GYT": "GYT", "CST": "CST", "HKST": "HKST", "IST": "IST", "LHST": "LHST", "EDT": "EDT", "HKT": "HKT", "AEDT": "AEDT", "AKDT": "AKDT", "ChST": "ChST", "ADT": "ADT", "NZST": "NZST", "HNEG": "HNEG", "HAT": "HAT", "WIT": "WIT", "TMST": "TMST", "MYT": "MYT", "∅∅∅": "∅∅∅", "OEZ": "OEZ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bem *bem) Locale() string {
+ return bem.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bem'
+func (bem *bem) PluralsCardinal() []locales.PluralRule {
+ return bem.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bem'
+func (bem *bem) PluralsOrdinal() []locales.PluralRule {
+ return bem.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bem'
+func (bem *bem) PluralsRange() []locales.PluralRule {
+ return bem.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bem'
+func (bem *bem) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bem'
+func (bem *bem) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bem'
+func (bem *bem) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bem *bem) MonthAbbreviated(month time.Month) string {
+ return bem.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bem *bem) MonthsAbbreviated() []string {
+ return bem.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bem *bem) MonthNarrow(month time.Month) string {
+ return bem.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bem *bem) MonthsNarrow() []string {
+ return bem.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bem *bem) MonthWide(month time.Month) string {
+ return bem.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bem *bem) MonthsWide() []string {
+ return bem.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bem *bem) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bem.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bem *bem) WeekdaysAbbreviated() []string {
+ return bem.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bem *bem) WeekdayNarrow(weekday time.Weekday) string {
+ return bem.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bem *bem) WeekdaysNarrow() []string {
+ return bem.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bem *bem) WeekdayShort(weekday time.Weekday) string {
+ return bem.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bem *bem) WeekdaysShort() []string {
+ return bem.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bem *bem) WeekdayWide(weekday time.Weekday) string {
+ return bem.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bem *bem) WeekdaysWide() []string {
+ return bem.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bem *bem) Decimal() string {
+ return bem.decimal
+}
+
+// Group returns the group of number
+func (bem *bem) Group() string {
+ return bem.group
+}
+
+// Group returns the minus sign of number
+func (bem *bem) Minus() string {
+ return bem.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bem' and handles both Whole and Real numbers based on 'v'
+func (bem *bem) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bem' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bem *bem) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bem'
+func (bem *bem) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bem.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bem.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bem.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, bem.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bem.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bem'
+// in accounting notation.
+func (bem *bem) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bem.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bem.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bem.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, bem.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bem.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bem.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bem'
+func (bem *bem) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bem'
+func (bem *bem) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bem'
+func (bem *bem) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bem'
+func (bem *bem) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bem.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bem'
+func (bem *bem) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bem'
+func (bem *bem) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bem'
+func (bem *bem) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bem'
+func (bem *bem) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bem.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bem/bem_test.go b/vendor/github.com/go-playground/locales/bem/bem_test.go
new file mode 100644
index 000000000..129750024
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bem/bem_test.go
@@ -0,0 +1,1120 @@
+package bem
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bem"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM.go b/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM.go
new file mode 100644
index 000000000..3a8208707
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM.go
@@ -0,0 +1,576 @@
+package bem_ZM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bem_ZM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bem_ZM' locale
+func New() locales.Translator {
+ return &bem_ZM{
+ locale: "bem_ZM",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Jan", "Feb", "Mac", "Epr", "Mei", "Jun", "Jul", "Oga", "Sep", "Okt", "Nov", "Dis"},
+ monthsNarrow: []string{"", "J", "F", "M", "E", "M", "J", "J", "O", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januari", "Februari", "Machi", "Epreo", "Mei", "Juni", "Julai", "Ogasti", "Septemba", "Oktoba", "Novemba", "Disemba"},
+ daysWide: []string{"Pa Mulungu", "Palichimo", "Palichibuli", "Palichitatu", "Palichine", "Palichisano", "Pachibelushi"},
+ periodsAbbreviated: []string{"uluchelo", "akasuba"},
+ periodsWide: []string{"uluchelo", "akasuba"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Before Yesu", "After Yesu"},
+ timezones: map[string]string{"TMST": "TMST", "HECU": "HECU", "WAT": "WAT", "WAST": "WAST", "SGT": "SGT", "EDT": "EDT", "WARST": "WARST", "CST": "CST", "AWST": "AWST", "ACST": "ACST", "HEPM": "HEPM", "CLT": "CLT", "COST": "COST", "SAST": "SAST", "ACDT": "ACDT", "OEZ": "OEZ", "ARST": "ARST", "JDT": "JDT", "MST": "MST", "WIT": "WIT", "WIB": "WIB", "AKDT": "AKDT", "HEEG": "HEEG", "IST": "IST", "WART": "WART", "HAT": "HAT", "WEZ": "WEZ", "ECT": "ECT", "HNOG": "HNOG", "MDT": "MDT", "GYT": "GYT", "PST": "PST", "HNEG": "HNEG", "MEZ": "MEZ", "VET": "VET", "BOT": "BOT", "HKST": "HKST", "OESZ": "OESZ", "WITA": "WITA", "HENOMX": "HENOMX", "MYT": "MYT", "ACWST": "ACWST", "HEOG": "HEOG", "MESZ": "MESZ", "HKT": "HKT", "HNPM": "HNPM", "BT": "BT", "ACWDT": "ACWDT", "HAST": "HAST", "ART": "ART", "GMT": "GMT", "UYT": "UYT", "AEDT": "AEDT", "SRT": "SRT", "COT": "COT", "AWDT": "AWDT", "AST": "AST", "ADT": "ADT", "LHST": "LHST", "LHDT": "LHDT", "HNT": "HNT", "PDT": "PDT", "AEST": "AEST", "NZDT": "NZDT", "∅∅∅": "∅∅∅", "HNNOMX": "HNNOMX", "CAT": "CAT", "HNCU": "HNCU", "WESZ": "WESZ", "HNPMX": "HNPMX", "HEPMX": "HEPMX", "AKST": "AKST", "EAT": "EAT", "ChST": "ChST", "CHAST": "CHAST", "CDT": "CDT", "EST": "EST", "CLST": "CLST", "TMT": "TMT", "HADT": "HADT", "UYST": "UYST", "CHADT": "CHADT", "JST": "JST", "NZST": "NZST", "GFT": "GFT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bem *bem_ZM) Locale() string {
+ return bem.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bem_ZM'
+func (bem *bem_ZM) PluralsCardinal() []locales.PluralRule {
+ return bem.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bem_ZM'
+func (bem *bem_ZM) PluralsOrdinal() []locales.PluralRule {
+ return bem.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bem_ZM'
+func (bem *bem_ZM) PluralsRange() []locales.PluralRule {
+ return bem.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bem_ZM'
+func (bem *bem_ZM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bem_ZM'
+func (bem *bem_ZM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bem_ZM'
+func (bem *bem_ZM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bem *bem_ZM) MonthAbbreviated(month time.Month) string {
+ return bem.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bem *bem_ZM) MonthsAbbreviated() []string {
+ return bem.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bem *bem_ZM) MonthNarrow(month time.Month) string {
+ return bem.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bem *bem_ZM) MonthsNarrow() []string {
+ return bem.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bem *bem_ZM) MonthWide(month time.Month) string {
+ return bem.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bem *bem_ZM) MonthsWide() []string {
+ return bem.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bem *bem_ZM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bem.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bem *bem_ZM) WeekdaysAbbreviated() []string {
+ return bem.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bem *bem_ZM) WeekdayNarrow(weekday time.Weekday) string {
+ return bem.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bem *bem_ZM) WeekdaysNarrow() []string {
+ return bem.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bem *bem_ZM) WeekdayShort(weekday time.Weekday) string {
+ return bem.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bem *bem_ZM) WeekdaysShort() []string {
+ return bem.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bem *bem_ZM) WeekdayWide(weekday time.Weekday) string {
+ return bem.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bem *bem_ZM) WeekdaysWide() []string {
+ return bem.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bem *bem_ZM) Decimal() string {
+ return bem.decimal
+}
+
+// Group returns the group of number
+func (bem *bem_ZM) Group() string {
+ return bem.group
+}
+
+// Group returns the minus sign of number
+func (bem *bem_ZM) Minus() string {
+ return bem.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bem_ZM' and handles both Whole and Real numbers based on 'v'
+func (bem *bem_ZM) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bem_ZM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bem *bem_ZM) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bem_ZM'
+func (bem *bem_ZM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bem.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bem.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bem.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, bem.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bem.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bem_ZM'
+// in accounting notation.
+func (bem *bem_ZM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bem.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bem.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bem.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, bem.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bem.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bem.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bem.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bem.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bem_ZM'
+func (bem *bem_ZM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bem.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bem.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bem.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bem.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM_test.go b/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM_test.go
new file mode 100644
index 000000000..b8acf9210
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bem_ZM/bem_ZM_test.go
@@ -0,0 +1,1120 @@
+package bem_ZM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bem_ZM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bez/bez.go b/vendor/github.com/go-playground/locales/bez/bez.go
new file mode 100644
index 000000000..ac755bd08
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bez/bez.go
@@ -0,0 +1,527 @@
+package bez
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bez struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bez' locale
+func New() locales.Translator {
+ return &bez{
+ locale: "bez",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TSh", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "Hut", "Vil", "Dat", "Tai", "Han", "Sit", "Sab", "Nan", "Tis", "Kum", "Kmj", "Kmb"},
+ monthsNarrow: []string{"", "H", "V", "D", "T", "H", "S", "S", "N", "T", "K", "K", "K"},
+ monthsWide: []string{"", "pa mwedzi gwa hutala", "pa mwedzi gwa wuvili", "pa mwedzi gwa wudatu", "pa mwedzi gwa wutai", "pa mwedzi gwa wuhanu", "pa mwedzi gwa sita", "pa mwedzi gwa saba", "pa mwedzi gwa nane", "pa mwedzi gwa tisa", "pa mwedzi gwa kumi", "pa mwedzi gwa kumi na moja", "pa mwedzi gwa kumi na mbili"},
+ daysAbbreviated: []string{"Mul", "Vil", "Hiv", "Hid", "Hit", "Hih", "Lem"},
+ daysNarrow: []string{"M", "J", "H", "H", "H", "W", "J"},
+ daysWide: []string{"pa mulungu", "pa shahuviluha", "pa hivili", "pa hidatu", "pa hitayi", "pa hihanu", "pa shahulembela"},
+ periodsAbbreviated: []string{"pamilau", "pamunyi"},
+ periodsWide: []string{"pamilau", "pamunyi"},
+ erasAbbreviated: []string{"KM", "BM"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla ya Mtwaa", "Baada ya Mtwaa"},
+ timezones: map[string]string{"NZST": "NZST", "ECT": "ECT", "ACDT": "ACDT", "WARST": "WARST", "CLT": "CLT", "ADT": "ADT", "AEDT": "AEDT", "HAST": "HAST", "PST": "PST", "IST": "IST", "WART": "WART", "WESZ": "WESZ", "∅∅∅": "∅∅∅", "LHST": "LHST", "HECU": "HECU", "MDT": "MDT", "SAST": "SAST", "HNEG": "HNEG", "MESZ": "MESZ", "AST": "AST", "AKST": "AKST", "GYT": "GYT", "HEPMX": "HEPMX", "WIB": "WIB", "HNPM": "HNPM", "HENOMX": "HENOMX", "AKDT": "AKDT", "SGT": "SGT", "TMST": "TMST", "ART": "ART", "UYST": "UYST", "CHADT": "CHADT", "WAST": "WAST", "NZDT": "NZDT", "WITA": "WITA", "UYT": "UYT", "AEST": "AEST", "WEZ": "WEZ", "HAT": "HAT", "OEZ": "OEZ", "HEEG": "HEEG", "HNOG": "HNOG", "HNNOMX": "HNNOMX", "EAT": "EAT", "TMT": "TMT", "COT": "COT", "GMT": "GMT", "WAT": "WAT", "JST": "JST", "HADT": "HADT", "ARST": "ARST", "CHAST": "CHAST", "HNCU": "HNCU", "BT": "BT", "HKT": "HKT", "CLST": "CLST", "WIT": "WIT", "COST": "COST", "CDT": "CDT", "HNPMX": "HNPMX", "HNT": "HNT", "HEPM": "HEPM", "MEZ": "MEZ", "CAT": "CAT", "CST": "CST", "PDT": "PDT", "MST": "MST", "GFT": "GFT", "LHDT": "LHDT", "ChST": "ChST", "AWST": "AWST", "AWDT": "AWDT", "MYT": "MYT", "EST": "EST", "HKST": "HKST", "SRT": "SRT", "OESZ": "OESZ", "JDT": "JDT", "ACWST": "ACWST", "ACST": "ACST", "ACWDT": "ACWDT", "HEOG": "HEOG", "VET": "VET", "BOT": "BOT", "EDT": "EDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bez *bez) Locale() string {
+ return bez.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bez'
+func (bez *bez) PluralsCardinal() []locales.PluralRule {
+ return bez.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bez'
+func (bez *bez) PluralsOrdinal() []locales.PluralRule {
+ return bez.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bez'
+func (bez *bez) PluralsRange() []locales.PluralRule {
+ return bez.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bez'
+func (bez *bez) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bez'
+func (bez *bez) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bez'
+func (bez *bez) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bez *bez) MonthAbbreviated(month time.Month) string {
+ return bez.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bez *bez) MonthsAbbreviated() []string {
+ return bez.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bez *bez) MonthNarrow(month time.Month) string {
+ return bez.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bez *bez) MonthsNarrow() []string {
+ return bez.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bez *bez) MonthWide(month time.Month) string {
+ return bez.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bez *bez) MonthsWide() []string {
+ return bez.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bez *bez) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bez.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bez *bez) WeekdaysAbbreviated() []string {
+ return bez.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bez *bez) WeekdayNarrow(weekday time.Weekday) string {
+ return bez.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bez *bez) WeekdaysNarrow() []string {
+ return bez.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bez *bez) WeekdayShort(weekday time.Weekday) string {
+ return bez.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bez *bez) WeekdaysShort() []string {
+ return bez.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bez *bez) WeekdayWide(weekday time.Weekday) string {
+ return bez.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bez *bez) WeekdaysWide() []string {
+ return bez.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bez *bez) Decimal() string {
+ return bez.decimal
+}
+
+// Group returns the group of number
+func (bez *bez) Group() string {
+ return bez.group
+}
+
+// Group returns the minus sign of number
+func (bez *bez) Minus() string {
+ return bez.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bez' and handles both Whole and Real numbers based on 'v'
+func (bez *bez) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bez' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bez *bez) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bez'
+func (bez *bez) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bez.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bez.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bez.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bez.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bez.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bez'
+// in accounting notation.
+func (bez *bez) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bez.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bez.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bez.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bez.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bez.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bez'
+func (bez *bez) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bez'
+func (bez *bez) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bez'
+func (bez *bez) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bez'
+func (bez *bez) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bez.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bez'
+func (bez *bez) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bez'
+func (bez *bez) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bez'
+func (bez *bez) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bez'
+func (bez *bez) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bez.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bez/bez_test.go b/vendor/github.com/go-playground/locales/bez/bez_test.go
new file mode 100644
index 000000000..c6a45ba8c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bez/bez_test.go
@@ -0,0 +1,1120 @@
+package bez
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bez"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ.go b/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ.go
new file mode 100644
index 000000000..e4519b2d6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ.go
@@ -0,0 +1,527 @@
+package bez_TZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bez_TZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bez_TZ' locale
+func New() locales.Translator {
+ return &bez_TZ{
+ locale: "bez_TZ",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "Hut", "Vil", "Dat", "Tai", "Han", "Sit", "Sab", "Nan", "Tis", "Kum", "Kmj", "Kmb"},
+ monthsNarrow: []string{"", "H", "V", "D", "T", "H", "S", "S", "N", "T", "K", "K", "K"},
+ monthsWide: []string{"", "pa mwedzi gwa hutala", "pa mwedzi gwa wuvili", "pa mwedzi gwa wudatu", "pa mwedzi gwa wutai", "pa mwedzi gwa wuhanu", "pa mwedzi gwa sita", "pa mwedzi gwa saba", "pa mwedzi gwa nane", "pa mwedzi gwa tisa", "pa mwedzi gwa kumi", "pa mwedzi gwa kumi na moja", "pa mwedzi gwa kumi na mbili"},
+ daysAbbreviated: []string{"Mul", "Vil", "Hiv", "Hid", "Hit", "Hih", "Lem"},
+ daysNarrow: []string{"M", "J", "H", "H", "H", "W", "J"},
+ daysWide: []string{"pa mulungu", "pa shahuviluha", "pa hivili", "pa hidatu", "pa hitayi", "pa hihanu", "pa shahulembela"},
+ periodsAbbreviated: []string{"pamilau", "pamunyi"},
+ periodsWide: []string{"pamilau", "pamunyi"},
+ erasAbbreviated: []string{"KM", "BM"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla ya Mtwaa", "Baada ya Mtwaa"},
+ timezones: map[string]string{"PDT": "PDT", "BT": "BT", "NZDT": "NZDT", "HEOG": "HEOG", "CHAST": "CHAST", "COST": "COST", "AWDT": "AWDT", "PST": "PST", "AEDT": "AEDT", "EDT": "EDT", "WARST": "WARST", "HEPM": "HEPM", "AKDT": "AKDT", "EST": "EST", "LHST": "LHST", "HADT": "HADT", "HEPMX": "HEPMX", "HNOG": "HNOG", "HKT": "HKT", "SRT": "SRT", "ARST": "ARST", "ChST": "ChST", "WESZ": "WESZ", "ACWDT": "ACWDT", "MESZ": "MESZ", "HNT": "HNT", "OESZ": "OESZ", "GMT": "GMT", "WAST": "WAST", "AKST": "AKST", "ACDT": "ACDT", "CLST": "CLST", "WIT": "WIT", "UYT": "UYT", "NZST": "NZST", "LHDT": "LHDT", "HENOMX": "HENOMX", "HNPMX": "HNPMX", "AEST": "AEST", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "HKST": "HKST", "CAT": "CAT", "TMST": "TMST", "HECU": "HECU", "CLT": "CLT", "CHADT": "CHADT", "HNCU": "HNCU", "VET": "VET", "AWST": "AWST", "WAT": "WAT", "BOT": "BOT", "GFT": "GFT", "JDT": "JDT", "MEZ": "MEZ", "SAST": "SAST", "JST": "JST", "IST": "IST", "ART": "ART", "UYST": "UYST", "GYT": "GYT", "CST": "CST", "WIB": "WIB", "HNPM": "HNPM", "HAT": "HAT", "COT": "COT", "HAST": "HAST", "AST": "AST", "SGT": "SGT", "HEEG": "HEEG", "ACST": "ACST", "WITA": "WITA", "HNNOMX": "HNNOMX", "OEZ": "OEZ", "MST": "MST", "MDT": "MDT", "ADT": "ADT", "ECT": "ECT", "TMT": "TMT", "EAT": "EAT", "CDT": "CDT", "WEZ": "WEZ", "MYT": "MYT", "HNEG": "HNEG", "WART": "WART"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bez *bez_TZ) Locale() string {
+ return bez.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bez_TZ'
+func (bez *bez_TZ) PluralsCardinal() []locales.PluralRule {
+ return bez.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bez_TZ'
+func (bez *bez_TZ) PluralsOrdinal() []locales.PluralRule {
+ return bez.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bez_TZ'
+func (bez *bez_TZ) PluralsRange() []locales.PluralRule {
+ return bez.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bez_TZ'
+func (bez *bez_TZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bez_TZ'
+func (bez *bez_TZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bez_TZ'
+func (bez *bez_TZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bez *bez_TZ) MonthAbbreviated(month time.Month) string {
+ return bez.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bez *bez_TZ) MonthsAbbreviated() []string {
+ return bez.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bez *bez_TZ) MonthNarrow(month time.Month) string {
+ return bez.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bez *bez_TZ) MonthsNarrow() []string {
+ return bez.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bez *bez_TZ) MonthWide(month time.Month) string {
+ return bez.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bez *bez_TZ) MonthsWide() []string {
+ return bez.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bez *bez_TZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bez.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bez *bez_TZ) WeekdaysAbbreviated() []string {
+ return bez.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bez *bez_TZ) WeekdayNarrow(weekday time.Weekday) string {
+ return bez.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bez *bez_TZ) WeekdaysNarrow() []string {
+ return bez.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bez *bez_TZ) WeekdayShort(weekday time.Weekday) string {
+ return bez.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bez *bez_TZ) WeekdaysShort() []string {
+ return bez.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bez *bez_TZ) WeekdayWide(weekday time.Weekday) string {
+ return bez.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bez *bez_TZ) WeekdaysWide() []string {
+ return bez.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bez *bez_TZ) Decimal() string {
+ return bez.decimal
+}
+
+// Group returns the group of number
+func (bez *bez_TZ) Group() string {
+ return bez.group
+}
+
+// Group returns the minus sign of number
+func (bez *bez_TZ) Minus() string {
+ return bez.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bez_TZ' and handles both Whole and Real numbers based on 'v'
+func (bez *bez_TZ) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bez_TZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bez *bez_TZ) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bez_TZ'
+func (bez *bez_TZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bez.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bez.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bez.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bez.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bez.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bez_TZ'
+// in accounting notation.
+func (bez *bez_TZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bez.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bez.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bez.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bez.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bez.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bez.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bez.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bez_TZ'
+func (bez *bez_TZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bez.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bez.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ_test.go b/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ_test.go
new file mode 100644
index 000000000..d52c782b3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bez_TZ/bez_TZ_test.go
@@ -0,0 +1,1120 @@
+package bez_TZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bez_TZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bg/bg.go b/vendor/github.com/go-playground/locales/bg/bg.go
new file mode 100644
index 000000000..f0a9f9e62
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bg/bg.go
@@ -0,0 +1,589 @@
+package bg
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bg struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bg' locale
+func New() locales.Translator {
+ return &bg{
+ locale: "bg",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "лв.", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "щ.д.", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "яну", "фев", "март", "апр", "май", "юни", "юли", "авг", "сеп", "окт", "ное", "дек"},
+ monthsNarrow: []string{"", "я", "ф", "м", "а", "м", "ю", "ю", "а", "с", "о", "н", "д"},
+ monthsWide: []string{"", "януари", "февруари", "март", "април", "май", "юни", "юли", "август", "септември", "октомври", "ноември", "декември"},
+ daysAbbreviated: []string{"нд", "пн", "вт", "ср", "чт", "пт", "сб"},
+ daysNarrow: []string{"н", "п", "в", "с", "ч", "п", "с"},
+ daysShort: []string{"нд", "пн", "вт", "ср", "чт", "пт", "сб"},
+ daysWide: []string{"неделя", "понеделник", "вторник", "сряда", "четвъртък", "петък", "събота"},
+ periodsAbbreviated: []string{"am", "pm"},
+ periodsNarrow: []string{"am", "pm"},
+ periodsWide: []string{"пр.об.", "сл.об."},
+ erasAbbreviated: []string{"пр.Хр.", "сл.Хр."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"преди Христа", "след Христа"},
+ timezones: map[string]string{"MST": "Северноамериканско планинско стандартно време", "WAST": "Западноафриканско лятно часово време", "HNOG": "Западногренландско стандартно време", "WARST": "Западноаржентинско лятно часово време", "HNPM": "Сен Пиер и Микелон – стандартно време", "HEPMX": "Мексиканско тихоокеанско лятно часово време", "ADT": "Северноамериканско атлантическо лятно часово време", "AEST": "Източноавстралийско стандартно време", "CLST": "Чилийско лятно часово време", "ACDT": "Централноавстралийско лятно часово време", "HEOG": "Западногренландско лятно часово време", "LHDT": "Лорд Хау – лятно часово време", "HNT": "Нюфаундлендско стандартно време", "HEPM": "Сен Пиер и Микелон – лятно часово време", "CHADT": "Чатъмско лятно часово време", "SAST": "Южноафриканско време", "AKST": "Аляска – стандартно време", "COST": "Колумбийско лятно часово време", "HEEG": "Източногренландско лятно часово време", "MEZ": "Централноевропейско стандартно време", "GMT": "Средно гринуичко време", "EDT": "Северноамериканско източно лятно часово време", "MESZ": "Централноевропейско лятно часово време", "HKT": "Хонконгско стандартно време", "HENOMX": "Северозападно лятно часово мексиканско време", "ART": "Аржентинско стандартно време", "HNPMX": "Мексиканско тихоокеанско стандартно време", "MDT": "Северноамериканско планинско лятно часово време", "BT": "Бутанско време", "HNNOMX": "Северозападно стандартно мексиканско време", "OEZ": "Източноевропейско стандартно време", "HNCU": "Кубинско стандартно време", "PST": "Северноамериканско тихоокеанско стандартно време", "LHST": "Лорд Хау – стандартно време", "UYST": "Уругвайско лятно часово време", "CST": "Северноамериканско централно стандартно време", "AKDT": "Аляска – лятно часово време", "HAST": "Хавайско-алеутско стандартно време", "EAT": "Източноафриканско време", "EST": "Северноамериканско източно стандартно време", "VET": "Венецуелско време", "SRT": "Суринамско време", "ACWST": "Австралия – западно централно стандартно време", "HAT": "Нюфаундлендско лятно часово време", "COT": "Колумбийско стандартно време", "∅∅∅": "Бразилско лятно часово време", "ECT": "Еквадорско време", "ACST": "Централноавстралийско стандартно време", "NZST": "Новозеландско стандартно време", "AEDT": "Източноавстралийско лятно часово време", "JST": "Японско стандартно време", "HADT": "Хавайско-алеутско лятно часово време", "CHAST": "Чатъмско стандартно време", "HECU": "Кубинско лятно часово време", "AWDT": "Западноавстралийско лятно часово време", "WESZ": "Западноевропейско лятно време", "JDT": "Японско лятно часово време", "IST": "Индийско време", "ACWDT": "Австралия – западно централно лятно часово време", "HNEG": "Източногренландско стандартно време", "CAT": "Централноафриканско време", "WIB": "Западноиндонезийско време", "GFT": "Френска Гвиана", "SGT": "Сингапурско време", "CLT": "Чилийско стандартно време", "TMT": "Туркменистанско стандартно време", "ARST": "Аржентинско лятно часово време", "ChST": "Чаморско време", "CDT": "Северноамериканско централно лятно часово време", "WEZ": "Западноевропейско стандартно време", "BOT": "Боливийско време", "TMST": "Туркменистанско лятно часово време", "UYT": "Уругвайско стандартно време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "HKST": "Хонконгско лятно часово време", "WITA": "Централноиндонезийско време", "MYT": "Малайзийско време", "OESZ": "Източноевропейско лятно часово време", "NZDT": "Новозеландско лятно часово време", "WART": "Западноаржентинско стандартно време", "WIT": "Източноиндонезийско време", "GYT": "Гаяна", "AWST": "Западноавстралийско стандартно време", "AST": "Северноамериканско атлантическо стандартно време", "WAT": "Западноафриканско стандартно време"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bg *bg) Locale() string {
+ return bg.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bg'
+func (bg *bg) PluralsCardinal() []locales.PluralRule {
+ return bg.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bg'
+func (bg *bg) PluralsOrdinal() []locales.PluralRule {
+ return bg.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bg'
+func (bg *bg) PluralsRange() []locales.PluralRule {
+ return bg.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bg'
+func (bg *bg) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bg'
+func (bg *bg) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bg'
+func (bg *bg) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bg *bg) MonthAbbreviated(month time.Month) string {
+ return bg.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bg *bg) MonthsAbbreviated() []string {
+ return bg.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bg *bg) MonthNarrow(month time.Month) string {
+ return bg.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bg *bg) MonthsNarrow() []string {
+ return bg.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bg *bg) MonthWide(month time.Month) string {
+ return bg.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bg *bg) MonthsWide() []string {
+ return bg.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bg *bg) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bg.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bg *bg) WeekdaysAbbreviated() []string {
+ return bg.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bg *bg) WeekdayNarrow(weekday time.Weekday) string {
+ return bg.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bg *bg) WeekdaysNarrow() []string {
+ return bg.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bg *bg) WeekdayShort(weekday time.Weekday) string {
+ return bg.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bg *bg) WeekdaysShort() []string {
+ return bg.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bg *bg) WeekdayWide(weekday time.Weekday) string {
+ return bg.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bg *bg) WeekdaysWide() []string {
+ return bg.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bg *bg) Decimal() string {
+ return bg.decimal
+}
+
+// Group returns the group of number
+func (bg *bg) Group() string {
+ return bg.group
+}
+
+// Group returns the minus sign of number
+func (bg *bg) Minus() string {
+ return bg.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bg' and handles both Whole and Real numbers based on 'v'
+func (bg *bg) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bg.group) - 1; j >= 0; j-- {
+ b = append(b, bg.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bg' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bg *bg) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bg.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bg'
+func (bg *bg) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bg.currencies[currency]
+ l := len(s) + len(symbol) + 4
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bg.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bg'
+// in accounting notation.
+func (bg *bg) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bg.currencies[currency]
+ l := len(s) + len(symbol) + 6
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bg.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bg.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bg.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bg'
+func (bg *bg) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bg'
+func (bg *bg) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bg'
+func (bg *bg) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bg'
+func (bg *bg) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bg.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bg'
+func (bg *bg) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bg'
+func (bg *bg) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bg'
+func (bg *bg) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bg'
+func (bg *bg) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bg.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bg/bg_test.go b/vendor/github.com/go-playground/locales/bg/bg_test.go
new file mode 100644
index 000000000..4228b64bb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bg/bg_test.go
@@ -0,0 +1,1120 @@
+package bg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bg_BG/bg_BG.go b/vendor/github.com/go-playground/locales/bg_BG/bg_BG.go
new file mode 100644
index 000000000..ed0fdc5bc
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bg_BG/bg_BG.go
@@ -0,0 +1,589 @@
+package bg_BG
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bg_BG struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bg_BG' locale
+func New() locales.Translator {
+ return &bg_BG{
+ locale: "bg_BG",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "яну", "фев", "март", "апр", "май", "юни", "юли", "авг", "сеп", "окт", "ное", "дек"},
+ monthsNarrow: []string{"", "я", "ф", "м", "а", "м", "ю", "ю", "а", "с", "о", "н", "д"},
+ monthsWide: []string{"", "януари", "февруари", "март", "април", "май", "юни", "юли", "август", "септември", "октомври", "ноември", "декември"},
+ daysAbbreviated: []string{"нд", "пн", "вт", "ср", "чт", "пт", "сб"},
+ daysNarrow: []string{"н", "п", "в", "с", "ч", "п", "с"},
+ daysShort: []string{"нд", "пн", "вт", "ср", "чт", "пт", "сб"},
+ daysWide: []string{"неделя", "понеделник", "вторник", "сряда", "четвъртък", "петък", "събота"},
+ periodsAbbreviated: []string{"am", "pm"},
+ periodsNarrow: []string{"am", "pm"},
+ periodsWide: []string{"пр.об.", "сл.об."},
+ erasAbbreviated: []string{"пр.Хр.", "сл.Хр."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"преди Христа", "след Христа"},
+ timezones: map[string]string{"∅∅∅": "Амазонско лятно часово време", "UYST": "Уругвайско лятно часово време", "ChST": "Чаморско време", "AWDT": "Западноавстралийско лятно часово време", "CAT": "Централноафриканско време", "PDT": "Северноамериканско тихоокеанско лятно часово време", "HEOG": "Западногренландско лятно часово време", "ACWST": "Австралия – западно централно стандартно време", "HEPM": "Сен Пиер и Микелон – лятно часово време", "MDT": "MDT", "ART": "Аржентинско стандартно време", "COST": "Колумбийско лятно часово време", "WAT": "Западноафриканско стандартно време", "AKST": "Аляска – стандартно време", "EST": "Северноамериканско източно стандартно време", "HNEG": "Източногренландско стандартно време", "MESZ": "Централноевропейско лятно часово време", "MST": "MST", "CHADT": "Чатъмско лятно часово време", "SAST": "Южноафриканско време", "ACDT": "Централноавстралийско лятно часово време", "CLT": "Чилийско стандартно време", "HAST": "Хавайско-алеутско стандартно време", "HNPMX": "Мексиканско тихоокеанско стандартно време", "ADT": "Северноамериканско атлантическо лятно часово време", "SRT": "Суринамско време", "GFT": "Френска Гвиана", "HNOG": "Западногренландско стандартно време", "HAT": "Нюфаундлендско лятно часово време", "WAST": "Западноафриканско лятно часово време", "PST": "Северноамериканско тихоокеанско стандартно време", "BT": "Бутанско време", "IST": "Индийско време", "LHST": "Лорд Хау – стандартно време", "HNT": "Нюфаундлендско стандартно време", "GMT": "Средно гринуичко време", "HEPMX": "Мексиканско тихоокеанско лятно часово време", "HEEG": "Източногренландско лятно часово време", "HKST": "Хонконгско лятно часово време", "VET": "Венецуелско време", "HNPM": "Сен Пиер и Микелон – стандартно време", "UYT": "Уругвайско стандартно време", "EAT": "Източноафриканско време", "COT": "Колумбийско стандартно време", "AEST": "Източноавстралийско стандартно време", "ACWDT": "Австралия – западно централно лятно часово време", "TMST": "Туркменистанско лятно часово време", "HADT": "Хавайско-алеутско лятно часово време", "GYT": "Гаяна", "CHAST": "Чатъмско стандартно време", "AEDT": "Източноавстралийско лятно часово време", "WEZ": "Западноевропейско стандартно време", "MEZ": "Централноевропейско стандартно време", "OESZ": "Източноевропейско лятно часово време", "WESZ": "Западноевропейско лятно време", "SGT": "Сингапурско време", "CLST": "Чилийско лятно часово време", "WIT": "Източноиндонезийско време", "CST": "Северноамериканско централно стандартно време", "AWST": "Западноавстралийско стандартно време", "AKDT": "Аляска – лятно часово време", "ACST": "Централноавстралийско стандартно време", "HNNOMX": "Северозападно стандартно мексиканско време", "HKT": "Хонконгско стандартно време", "WITA": "Централноиндонезийско време", "AST": "Северноамериканско атлантическо стандартно време", "OEZ": "Източноевропейско стандартно време", "ARST": "Аржентинско лятно часово време", "JST": "Японско стандартно време", "NZST": "Новозеландско стандартно време", "EDT": "Северноамериканско източно лятно часово време", "TMT": "Туркменистанско стандартно време", "WIB": "Западноиндонезийско време", "JDT": "Японско лятно часово време", "LHDT": "Лорд Хау – лятно часово време", "WART": "Западноаржентинско стандартно време", "HNCU": "Кубинско стандартно време", "HECU": "Кубинско лятно часово време", "CDT": "Северноамериканско централно лятно часово време", "NZDT": "Новозеландско лятно часово време", "MYT": "Малайзийско време", "BOT": "Боливийско време", "ECT": "Еквадорско време", "WARST": "Западноаржентинско лятно часово време", "HENOMX": "Северозападно лятно часово мексиканско време"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bg *bg_BG) Locale() string {
+ return bg.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bg_BG'
+func (bg *bg_BG) PluralsCardinal() []locales.PluralRule {
+ return bg.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bg_BG'
+func (bg *bg_BG) PluralsOrdinal() []locales.PluralRule {
+ return bg.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bg_BG'
+func (bg *bg_BG) PluralsRange() []locales.PluralRule {
+ return bg.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bg_BG'
+func (bg *bg_BG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bg_BG'
+func (bg *bg_BG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bg_BG'
+func (bg *bg_BG) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bg *bg_BG) MonthAbbreviated(month time.Month) string {
+ return bg.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bg *bg_BG) MonthsAbbreviated() []string {
+ return bg.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bg *bg_BG) MonthNarrow(month time.Month) string {
+ return bg.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bg *bg_BG) MonthsNarrow() []string {
+ return bg.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bg *bg_BG) MonthWide(month time.Month) string {
+ return bg.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bg *bg_BG) MonthsWide() []string {
+ return bg.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bg *bg_BG) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bg.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bg *bg_BG) WeekdaysAbbreviated() []string {
+ return bg.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bg *bg_BG) WeekdayNarrow(weekday time.Weekday) string {
+ return bg.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bg *bg_BG) WeekdaysNarrow() []string {
+ return bg.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bg *bg_BG) WeekdayShort(weekday time.Weekday) string {
+ return bg.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bg *bg_BG) WeekdaysShort() []string {
+ return bg.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bg *bg_BG) WeekdayWide(weekday time.Weekday) string {
+ return bg.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bg *bg_BG) WeekdaysWide() []string {
+ return bg.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bg *bg_BG) Decimal() string {
+ return bg.decimal
+}
+
+// Group returns the group of number
+func (bg *bg_BG) Group() string {
+ return bg.group
+}
+
+// Group returns the minus sign of number
+func (bg *bg_BG) Minus() string {
+ return bg.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bg_BG' and handles both Whole and Real numbers based on 'v'
+func (bg *bg_BG) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(bg.group) - 1; j >= 0; j-- {
+ b = append(b, bg.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bg_BG' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bg *bg_BG) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bg.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bg_BG'
+func (bg *bg_BG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bg.currencies[currency]
+ l := len(s) + len(symbol) + 4
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bg.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bg_BG'
+// in accounting notation.
+func (bg *bg_BG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bg.currencies[currency]
+ l := len(s) + len(symbol) + 6
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bg.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bg.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bg.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bg.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bg.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xd0, 0xb3}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bg_BG'
+func (bg *bg_BG) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20, 0xd1, 0x87}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bg.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bg_BG/bg_BG_test.go b/vendor/github.com/go-playground/locales/bg_BG/bg_BG_test.go
new file mode 100644
index 000000000..d180eede0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bg_BG/bg_BG_test.go
@@ -0,0 +1,1120 @@
+package bg_BG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bg_BG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bm/bm.go b/vendor/github.com/go-playground/locales/bm/bm.go
new file mode 100644
index 000000000..dd44e1a70
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bm/bm.go
@@ -0,0 +1,521 @@
+package bm
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bm struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bm' locale
+func New() locales.Translator {
+ return &bm{
+ locale: "bm",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "zan", "feb", "mar", "awi", "mɛ", "zuw", "zul", "uti", "sɛt", "ɔku", "now", "des"},
+ monthsNarrow: []string{"", "Z", "F", "M", "A", "M", "Z", "Z", "U", "S", "Ɔ", "N", "D"},
+ monthsWide: []string{"", "zanwuye", "feburuye", "marisi", "awirili", "mɛ", "zuwɛn", "zuluye", "uti", "sɛtanburu", "ɔkutɔburu", "nowanburu", "desanburu"},
+ daysAbbreviated: []string{"kar", "ntɛ", "tar", "ara", "ala", "jum", "sib"},
+ daysNarrow: []string{"K", "N", "T", "A", "A", "J", "S"},
+ daysWide: []string{"kari", "ntɛnɛ", "tarata", "araba", "alamisa", "juma", "sibiri"},
+ erasAbbreviated: []string{"J.-C. ɲɛ", "ni J.-C."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"jezu krisiti ɲɛ", "jezu krisiti minkɛ"},
+ timezones: map[string]string{"∅∅∅": "∅∅∅", "HKST": "HKST", "SRT": "SRT", "ART": "ART", "HKT": "HKT", "JST": "JST", "AKST": "AKST", "ACWST": "ACWST", "HEPMX": "HEPMX", "AST": "AST", "ADT": "ADT", "BT": "BT", "ACDT": "ACDT", "MDT": "MDT", "HNPMX": "HNPMX", "WEZ": "WEZ", "HNT": "HNT", "TMST": "TMST", "COT": "COT", "ACWDT": "ACWDT", "WARST": "WARST", "IST": "IST", "HNPM": "HNPM", "WITA": "WITA", "WIB": "WIB", "GFT": "GFT", "HEOG": "HEOG", "EST": "EST", "ACST": "ACST", "COST": "COST", "OESZ": "OESZ", "MEZ": "MEZ", "HAT": "HAT", "MST": "MST", "ChST": "ChST", "AEDT": "AEDT", "VET": "VET", "OEZ": "OEZ", "GMT": "GMT", "WAST": "WAST", "MYT": "MYT", "JDT": "JDT", "CST": "CST", "WESZ": "WESZ", "MESZ": "MESZ", "CLST": "CLST", "EAT": "EAT", "HAST": "HAST", "HADT": "HADT", "HNOG": "HNOG", "UYT": "UYT", "AWDT": "AWDT", "WAT": "WAT", "AKDT": "AKDT", "ECT": "ECT", "HNEG": "HNEG", "HEPM": "HEPM", "HENOMX": "HENOMX", "GYT": "GYT", "CDT": "CDT", "CAT": "CAT", "CHADT": "CHADT", "AWST": "AWST", "NZDT": "NZDT", "SGT": "SGT", "CLT": "CLT", "PST": "PST", "AEST": "AEST", "BOT": "BOT", "ARST": "ARST", "UYST": "UYST", "HECU": "HECU", "EDT": "EDT", "LHST": "LHST", "LHDT": "LHDT", "WIT": "WIT", "TMT": "TMT", "PDT": "PDT", "SAST": "SAST", "NZST": "NZST", "HEEG": "HEEG", "WART": "WART", "HNNOMX": "HNNOMX", "CHAST": "CHAST", "HNCU": "HNCU"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bm *bm) Locale() string {
+ return bm.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bm'
+func (bm *bm) PluralsCardinal() []locales.PluralRule {
+ return bm.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bm'
+func (bm *bm) PluralsOrdinal() []locales.PluralRule {
+ return bm.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bm'
+func (bm *bm) PluralsRange() []locales.PluralRule {
+ return bm.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bm'
+func (bm *bm) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bm'
+func (bm *bm) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bm'
+func (bm *bm) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bm *bm) MonthAbbreviated(month time.Month) string {
+ return bm.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bm *bm) MonthsAbbreviated() []string {
+ return bm.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bm *bm) MonthNarrow(month time.Month) string {
+ return bm.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bm *bm) MonthsNarrow() []string {
+ return bm.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bm *bm) MonthWide(month time.Month) string {
+ return bm.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bm *bm) MonthsWide() []string {
+ return bm.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bm *bm) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bm.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bm *bm) WeekdaysAbbreviated() []string {
+ return bm.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bm *bm) WeekdayNarrow(weekday time.Weekday) string {
+ return bm.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bm *bm) WeekdaysNarrow() []string {
+ return bm.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bm *bm) WeekdayShort(weekday time.Weekday) string {
+ return bm.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bm *bm) WeekdaysShort() []string {
+ return bm.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bm *bm) WeekdayWide(weekday time.Weekday) string {
+ return bm.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bm *bm) WeekdaysWide() []string {
+ return bm.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bm *bm) Decimal() string {
+ return bm.decimal
+}
+
+// Group returns the group of number
+func (bm *bm) Group() string {
+ return bm.group
+}
+
+// Group returns the minus sign of number
+func (bm *bm) Minus() string {
+ return bm.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bm' and handles both Whole and Real numbers based on 'v'
+func (bm *bm) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bm' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bm *bm) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bm'
+func (bm *bm) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bm.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bm.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bm.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, bm.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bm.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bm'
+// in accounting notation.
+func (bm *bm) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bm.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bm.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bm.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, bm.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bm.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bm.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bm'
+func (bm *bm) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bm'
+func (bm *bm) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bm'
+func (bm *bm) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bm'
+func (bm *bm) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bm.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bm'
+func (bm *bm) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bm'
+func (bm *bm) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bm'
+func (bm *bm) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bm'
+func (bm *bm) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bm.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bm/bm_test.go b/vendor/github.com/go-playground/locales/bm/bm_test.go
new file mode 100644
index 000000000..fdd3f61dc
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bm/bm_test.go
@@ -0,0 +1,1120 @@
+package bm
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bm"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bm_ML/bm_ML.go b/vendor/github.com/go-playground/locales/bm_ML/bm_ML.go
new file mode 100644
index 000000000..60de018e3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bm_ML/bm_ML.go
@@ -0,0 +1,521 @@
+package bm_ML
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bm_ML struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bm_ML' locale
+func New() locales.Translator {
+ return &bm_ML{
+ locale: "bm_ML",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "zan", "feb", "mar", "awi", "mɛ", "zuw", "zul", "uti", "sɛt", "ɔku", "now", "des"},
+ monthsNarrow: []string{"", "Z", "F", "M", "A", "M", "Z", "Z", "U", "S", "Ɔ", "N", "D"},
+ monthsWide: []string{"", "zanwuye", "feburuye", "marisi", "awirili", "mɛ", "zuwɛn", "zuluye", "uti", "sɛtanburu", "ɔkutɔburu", "nowanburu", "desanburu"},
+ daysAbbreviated: []string{"kar", "ntɛ", "tar", "ara", "ala", "jum", "sib"},
+ daysNarrow: []string{"K", "N", "T", "A", "A", "J", "S"},
+ daysWide: []string{"kari", "ntɛnɛ", "tarata", "araba", "alamisa", "juma", "sibiri"},
+ erasAbbreviated: []string{"J.-C. ɲɛ", "ni J.-C."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"jezu krisiti ɲɛ", "jezu krisiti minkɛ"},
+ timezones: map[string]string{"CHAST": "CHAST", "WAST": "WAST", "JDT": "JDT", "SGT": "SGT", "HKT": "HKT", "COT": "COT", "GYT": "GYT", "AKDT": "AKDT", "WART": "WART", "AWDT": "AWDT", "AST": "AST", "WESZ": "WESZ", "UYST": "UYST", "HEPMX": "HEPMX", "MYT": "MYT", "NZST": "NZST", "ACWST": "ACWST", "COST": "COST", "HAST": "HAST", "WIT": "WIT", "AWST": "AWST", "CDT": "CDT", "BOT": "BOT", "HEEG": "HEEG", "EST": "EST", "EDT": "EDT", "MST": "MST", "GFT": "GFT", "ChST": "ChST", "BT": "BT", "ECT": "ECT", "HNPMX": "HNPMX", "AEST": "AEST", "NZDT": "NZDT", "AKST": "AKST", "HKST": "HKST", "CAT": "CAT", "SAST": "SAST", "CLT": "CLT", "HNCU": "HNCU", "ADT": "ADT", "HNOG": "HNOG", "WARST": "WARST", "GMT": "GMT", "CHADT": "CHADT", "HECU": "HECU", "∅∅∅": "∅∅∅", "UYT": "UYT", "CST": "CST", "PST": "PST", "AEDT": "AEDT", "MEZ": "MEZ", "SRT": "SRT", "ARST": "ARST", "HADT": "HADT", "LHST": "LHST", "MDT": "MDT", "EAT": "EAT", "OEZ": "OEZ", "WIB": "WIB", "TMST": "TMST", "ART": "ART", "OESZ": "OESZ", "JST": "JST", "ACWDT": "ACWDT", "MESZ": "MESZ", "HNNOMX": "HNNOMX", "HENOMX": "HENOMX", "WEZ": "WEZ", "WAT": "WAT", "LHDT": "LHDT", "HNPM": "HNPM", "HNT": "HNT", "HAT": "HAT", "CLST": "CLST", "TMT": "TMT", "PDT": "PDT", "ACST": "ACST", "IST": "IST", "HEPM": "HEPM", "WITA": "WITA", "VET": "VET", "HNEG": "HNEG", "HEOG": "HEOG", "ACDT": "ACDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bm *bm_ML) Locale() string {
+ return bm.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bm_ML'
+func (bm *bm_ML) PluralsCardinal() []locales.PluralRule {
+ return bm.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bm_ML'
+func (bm *bm_ML) PluralsOrdinal() []locales.PluralRule {
+ return bm.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bm_ML'
+func (bm *bm_ML) PluralsRange() []locales.PluralRule {
+ return bm.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bm_ML'
+func (bm *bm_ML) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bm_ML'
+func (bm *bm_ML) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bm_ML'
+func (bm *bm_ML) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bm *bm_ML) MonthAbbreviated(month time.Month) string {
+ return bm.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bm *bm_ML) MonthsAbbreviated() []string {
+ return bm.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bm *bm_ML) MonthNarrow(month time.Month) string {
+ return bm.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bm *bm_ML) MonthsNarrow() []string {
+ return bm.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bm *bm_ML) MonthWide(month time.Month) string {
+ return bm.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bm *bm_ML) MonthsWide() []string {
+ return bm.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bm *bm_ML) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bm.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bm *bm_ML) WeekdaysAbbreviated() []string {
+ return bm.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bm *bm_ML) WeekdayNarrow(weekday time.Weekday) string {
+ return bm.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bm *bm_ML) WeekdaysNarrow() []string {
+ return bm.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bm *bm_ML) WeekdayShort(weekday time.Weekday) string {
+ return bm.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bm *bm_ML) WeekdaysShort() []string {
+ return bm.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bm *bm_ML) WeekdayWide(weekday time.Weekday) string {
+ return bm.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bm *bm_ML) WeekdaysWide() []string {
+ return bm.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bm *bm_ML) Decimal() string {
+ return bm.decimal
+}
+
+// Group returns the group of number
+func (bm *bm_ML) Group() string {
+ return bm.group
+}
+
+// Group returns the minus sign of number
+func (bm *bm_ML) Minus() string {
+ return bm.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bm_ML' and handles both Whole and Real numbers based on 'v'
+func (bm *bm_ML) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bm_ML' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bm *bm_ML) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bm_ML'
+func (bm *bm_ML) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bm.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bm.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bm.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, bm.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bm.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bm_ML'
+// in accounting notation.
+func (bm *bm_ML) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bm.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bm.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bm.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, bm.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bm.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bm.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bm.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bm.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bm_ML'
+func (bm *bm_ML) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bm.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bm.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bm_ML/bm_ML_test.go b/vendor/github.com/go-playground/locales/bm_ML/bm_ML_test.go
new file mode 100644
index 000000000..d43f678df
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bm_ML/bm_ML_test.go
@@ -0,0 +1,1120 @@
+package bm_ML
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bm_ML"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bn/bn.go b/vendor/github.com/go-playground/locales/bn/bn.go
new file mode 100644
index 000000000..6a5ea9c29
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn/bn.go
@@ -0,0 +1,675 @@
+package bn
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bn struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bn' locale
+func New() locales.Translator {
+ return &bn{
+ locale: "bn",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "৳", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ monthsNarrow: []string{"", "জা", "ফে", "মা", "এ", "মে", "জুন", "জু", "আ", "সে", "অ", "ন", "ডি"},
+ monthsWide: []string{"", "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ daysAbbreviated: []string{"রবি", "সোম", "মঙ্গল", "বুধ", "বৃহস্পতি", "শুক্র", "শনি"},
+ daysNarrow: []string{"র", "সো", "ম", "বু", "বৃ", "শু", "শ"},
+ daysShort: []string{"রঃ", "সোঃ", "মঃ", "বুঃ", "বৃঃ", "শুঃ", "শোঃ"},
+ daysWide: []string{"রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"খ্রিস্টপূর্ব", "খ্রীষ্টাব্দ"},
+ timezones: map[string]string{"HNOG": "পশ্চিম গ্রীনল্যান্ড মানক সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "VET": "ভেনেজুয়েলা সময়", "HNNOMX": "উত্তরপশ্চিম মেক্সিকোর মানক সময়", "EAT": "পূর্ব আফ্রিকা সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "AKDT": "আলাস্কা দিবালোক সময়", "CLT": "চিলি মানক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "HNCU": "কিউবা মানক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "IST": "ভারতীয় মানক সময়", "CLST": "চিলি গ্রীষ্মকালীন সময়", "OESZ": "পূর্ব ইউরোপীয় গ্রীষ্মকালীন সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "BT": "ভুটান সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "AST": "অতলান্তিক মানক সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "MDT": "পার্বত্য অঞ্চলের দিনের সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "ART": "আর্জেন্টিনা মানক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "HEEG": "পূর্ব গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "WEZ": "পশ্চিম ইউরোপীয় মানক সময়", "CAT": "মধ্য আফ্রিকা সময়", "JDT": "জাপান দিবালোক সময়", "GMT": "গ্রীনিচ মিন টাইম", "HNPM": "সেন্ট পিয়ের ও মিকেলন মানক সময়", "ARST": "আর্জেন্টিনা গ্রীষ্মকালীন সময়", "HNPMX": "মেক্সিকান প্রশান্ত মহসাগরীয় মানক সময়", "AKST": "আলাস্কা মানক সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "MEZ": "মধ্য ইউরোপীয় মানক সময়", "HKT": "হং কং মানক সময়", "SRT": "সুরিনাম সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "AWST": "অস্ট্রেলীয় পশ্চিমি মানক সময়", "JST": "জাপান মানক সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "BOT": "বোলিভিয়া সময়", "GFT": "ফরাসি গায়ানা সময়", "WESZ": "পশ্চিম ইউরোপীয় গ্রীষ্মকালীন সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "HNEG": "পূর্ব গ্রীনল্যান্ড মানক সময়", "MESZ": "মধ্য ইউরোপীয় গ্রীষ্মকালীন সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "ChST": "চামেরো মানক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের মানক সময়", "MST": "পার্বত্য অঞ্চলের প্রমাণ সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "HEPM": "সেন্ট পিয়ের ও মিকেলন দিবালোক সময়", "MYT": "মালয়েশিয়া সময়", "HECU": "কিউবা দিবালোক সময়", "CST": "কেন্দ্রীয় মানক সময়", "HEPMX": "মেক্সিকান প্রশান্ত মহাসাগরীয় দিবালোক সময়", "CHAST": "চ্যাথাম মানক সময়", "HEOG": "পশ্চিম গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "UYT": "উরুগুয়ে মানক সময়", "HENOMX": "উত্তরপশ্চিম মেক্সিকোর দিনের সময়", "OEZ": "পূর্ব ইউরোপীয় মানক সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "GYT": "গুয়ানা সময়", "ADT": "অতলান্তিক দিবালোক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "WARST": "পশ্চিমি আর্জেনটিনা গ্রীষ্মকালীন সময়", "COT": "কোলোম্বিয়া মানক সময়", "∅∅∅": "ব্রাসিলিয়া গ্রীষ্মকালীন সময়", "ECT": "ইকুয়েডর সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bn *bn) Locale() string {
+ return bn.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bn'
+func (bn *bn) PluralsCardinal() []locales.PluralRule {
+ return bn.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bn'
+func (bn *bn) PluralsOrdinal() []locales.PluralRule {
+ return bn.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bn'
+func (bn *bn) PluralsRange() []locales.PluralRule {
+ return bn.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bn'
+func (bn *bn) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bn'
+func (bn *bn) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
+ return locales.PluralRuleOne
+ } else if n == 2 || n == 3 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bn'
+func (bn *bn) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bn.CardinalPluralRule(num1, v1)
+ end := bn.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bn *bn) MonthAbbreviated(month time.Month) string {
+ return bn.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bn *bn) MonthsAbbreviated() []string {
+ return bn.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bn *bn) MonthNarrow(month time.Month) string {
+ return bn.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bn *bn) MonthsNarrow() []string {
+ return bn.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bn *bn) MonthWide(month time.Month) string {
+ return bn.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bn *bn) MonthsWide() []string {
+ return bn.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bn *bn) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bn.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bn *bn) WeekdaysAbbreviated() []string {
+ return bn.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bn *bn) WeekdayNarrow(weekday time.Weekday) string {
+ return bn.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bn *bn) WeekdaysNarrow() []string {
+ return bn.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bn *bn) WeekdayShort(weekday time.Weekday) string {
+ return bn.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bn *bn) WeekdaysShort() []string {
+ return bn.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bn *bn) WeekdayWide(weekday time.Weekday) string {
+ return bn.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bn *bn) WeekdaysWide() []string {
+ return bn.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bn *bn) Decimal() string {
+ return bn.decimal
+}
+
+// Group returns the group of number
+func (bn *bn) Group() string {
+ return bn.group
+}
+
+// Group returns the minus sign of number
+func (bn *bn) Minus() string {
+ return bn.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bn' and handles both Whole and Real numbers based on 'v'
+func (bn *bn) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bn' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bn *bn) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bn.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bn'
+func (bn *bn) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bn'
+// in accounting notation.
+func (bn *bn) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bn.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bn'
+func (bn *bn) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bn'
+func (bn *bn) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bn'
+func (bn *bn) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bn'
+func (bn *bn) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bn.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bn'
+func (bn *bn) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bn'
+func (bn *bn) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bn'
+func (bn *bn) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bn'
+func (bn *bn) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bn.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bn/bn_test.go b/vendor/github.com/go-playground/locales/bn/bn_test.go
new file mode 100644
index 000000000..d651cb3c4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn/bn_test.go
@@ -0,0 +1,1120 @@
+package bn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bn_BD/bn_BD.go b/vendor/github.com/go-playground/locales/bn_BD/bn_BD.go
new file mode 100644
index 000000000..506f976e4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn_BD/bn_BD.go
@@ -0,0 +1,675 @@
+package bn_BD
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bn_BD struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bn_BD' locale
+func New() locales.Translator {
+ return &bn_BD{
+ locale: "bn_BD",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ monthsNarrow: []string{"", "জা", "ফে", "মা", "এ", "মে", "জুন", "জু", "আ", "সে", "অ", "ন", "ডি"},
+ monthsWide: []string{"", "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ daysAbbreviated: []string{"রবি", "সোম", "মঙ্গল", "বুধ", "বৃহস্পতি", "শুক্র", "শনি"},
+ daysNarrow: []string{"র", "সো", "ম", "বু", "বৃ", "শু", "শ"},
+ daysShort: []string{"রঃ", "সোঃ", "মঃ", "বুঃ", "বৃঃ", "শুঃ", "শোঃ"},
+ daysWide: []string{"রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"খ্রিস্টপূর্ব", "খ্রীষ্টাব্দ"},
+ timezones: map[string]string{"VET": "ভেনেজুয়েলা সময়", "∅∅∅": "অ্যামাজন গ্রীষ্মকালীন সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "UYT": "উরুগুয়ে মানক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "HEOG": "পশ্চিম গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "MEZ": "মধ্য ইউরোপীয় মানক সময়", "CLT": "চিলি মানক সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "EAT": "পূর্ব আফ্রিকা সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "MYT": "মালয়েশিয়া সময়", "HNEG": "পূর্ব গ্রীনল্যান্ড মানক সময়", "HNOG": "পশ্চিম গ্রীনল্যান্ড মানক সময়", "HNPM": "সেন্ট পিয়ের ও মিকেলন মানক সময়", "SRT": "সুরিনাম সময়", "OESZ": "পূর্ব ইউরোপীয় গ্রীষ্মকালীন সময়", "GYT": "গুয়ানা সময়", "CST": "কেন্দ্রীয় মানক সময়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "CLST": "চিলি গ্রীষ্মকালীন সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "HEEG": "পূর্ব গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "COT": "কোলোম্বিয়া মানক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "HNNOMX": "উত্তরপশ্চিম মেক্সিকোর মানক সময়", "GMT": "গ্রীনিচ মিন টাইম", "AKST": "আলাস্কা মানক সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "MDT": "মাকাও গ্রীষ্মকাল সময়", "CAT": "মধ্য আফ্রিকা সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "HEPMX": "মেক্সিকান প্রশান্ত মহাসাগরীয় দিবালোক সময়", "ADT": "অতলান্তিক দিবালোক সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "EDT": "পূর্বাঞ্চলের দিবালোক সময়", "MESZ": "মধ্য ইউরোপীয় গ্রীষ্মকালীন সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের মানক সময়", "BOT": "বোলিভিয়া সময়", "CHAST": "চ্যাথাম মানক সময়", "GFT": "ফরাসি গায়ানা সময়", "JST": "জাপান মানক সময়", "ECT": "ইকুয়েডর সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "ChST": "চামেরো মানক সময়", "AST": "অতলান্তিক মানক সময়", "HKT": "হং কং মানক সময়", "HEPM": "সেন্ট পিয়ের ও মিকেলন দিবালোক সময়", "MST": "মাকাও মান সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "AKDT": "আলাস্কা দিবালোক সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "WEZ": "পশ্চিম ইউরোপীয় মানক সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "ARST": "আর্জেন্টিনা গ্রীষ্মকালীন সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "AWST": "অস্ট্রেলীয় পশ্চিমি মানক সময়", "WESZ": "পশ্চিম ইউরোপীয় গ্রীষ্মকালীন সময়", "WARST": "পশ্চিমি আর্জেনটিনা গ্রীষ্মকালীন সময়", "IST": "ভারতীয় মানক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "JDT": "জাপান দিবালোক সময়", "BT": "ভুটান সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "HENOMX": "উত্তরপশ্চিম মেক্সিকোর দিনের সময়", "ART": "আর্জেন্টিনা মানক সময়", "HNCU": "কিউবা মানক সময়", "HNPMX": "মেক্সিকান প্রশান্ত মহসাগরীয় মানক সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "OEZ": "পূর্ব ইউরোপীয় মানক সময়", "HECU": "কিউবা দিবালোক সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "LHST": "লর্ড হাওয়ে মানক মসয়"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bn *bn_BD) Locale() string {
+ return bn.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bn_BD'
+func (bn *bn_BD) PluralsCardinal() []locales.PluralRule {
+ return bn.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bn_BD'
+func (bn *bn_BD) PluralsOrdinal() []locales.PluralRule {
+ return bn.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bn_BD'
+func (bn *bn_BD) PluralsRange() []locales.PluralRule {
+ return bn.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bn_BD'
+func (bn *bn_BD) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bn_BD'
+func (bn *bn_BD) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
+ return locales.PluralRuleOne
+ } else if n == 2 || n == 3 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bn_BD'
+func (bn *bn_BD) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bn.CardinalPluralRule(num1, v1)
+ end := bn.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bn *bn_BD) MonthAbbreviated(month time.Month) string {
+ return bn.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bn *bn_BD) MonthsAbbreviated() []string {
+ return bn.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bn *bn_BD) MonthNarrow(month time.Month) string {
+ return bn.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bn *bn_BD) MonthsNarrow() []string {
+ return bn.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bn *bn_BD) MonthWide(month time.Month) string {
+ return bn.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bn *bn_BD) MonthsWide() []string {
+ return bn.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bn *bn_BD) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bn.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bn *bn_BD) WeekdaysAbbreviated() []string {
+ return bn.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bn *bn_BD) WeekdayNarrow(weekday time.Weekday) string {
+ return bn.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bn *bn_BD) WeekdaysNarrow() []string {
+ return bn.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bn *bn_BD) WeekdayShort(weekday time.Weekday) string {
+ return bn.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bn *bn_BD) WeekdaysShort() []string {
+ return bn.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bn *bn_BD) WeekdayWide(weekday time.Weekday) string {
+ return bn.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bn *bn_BD) WeekdaysWide() []string {
+ return bn.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bn *bn_BD) Decimal() string {
+ return bn.decimal
+}
+
+// Group returns the group of number
+func (bn *bn_BD) Group() string {
+ return bn.group
+}
+
+// Group returns the minus sign of number
+func (bn *bn_BD) Minus() string {
+ return bn.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bn_BD' and handles both Whole and Real numbers based on 'v'
+func (bn *bn_BD) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bn_BD' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bn *bn_BD) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bn.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bn_BD'
+func (bn *bn_BD) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bn_BD'
+// in accounting notation.
+func (bn *bn_BD) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bn.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bn.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bn_BD'
+func (bn *bn_BD) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bn.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bn_BD/bn_BD_test.go b/vendor/github.com/go-playground/locales/bn_BD/bn_BD_test.go
new file mode 100644
index 000000000..55bde34d3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn_BD/bn_BD_test.go
@@ -0,0 +1,1120 @@
+package bn_BD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn_BD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bn_IN/bn_IN.go b/vendor/github.com/go-playground/locales/bn_IN/bn_IN.go
new file mode 100644
index 000000000..1125ea7cd
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn_IN/bn_IN.go
@@ -0,0 +1,675 @@
+package bn_IN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bn_IN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bn_IN' locale
+func New() locales.Translator {
+ return &bn_IN{
+ locale: "bn_IN",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "জানু", "ফেব", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ monthsNarrow: []string{"", "জা", "ফে", "মা", "এ", "মে", "জুন", "জু", "আ", "সে", "অ", "ন", "ডি"},
+ monthsWide: []string{"", "জানুয়ারী", "ফেব্রুয়ারী", "মার্চ", "এপ্রিল", "মে", "জুন", "জুলাই", "আগস্ট", "সেপ্টেম্বর", "অক্টোবর", "নভেম্বর", "ডিসেম্বর"},
+ daysAbbreviated: []string{"রবি", "সোম", "মঙ্গল", "বুধ", "বৃহস্পতি", "শুক্র", "শনি"},
+ daysNarrow: []string{"র", "সো", "ম", "বু", "বৃ", "শু", "শ"},
+ daysShort: []string{"রঃ", "সোঃ", "মঃ", "বুঃ", "বৃঃ", "শুঃ", "শোঃ"},
+ daysWide: []string{"রবিবার", "সোমবার", "মঙ্গলবার", "বুধবার", "বৃহস্পতিবার", "শুক্রবার", "শনিবার"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"খ্রিস্টপূর্ব", "খৃষ্টাব্দ"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"খ্রিস্টপূর্ব", "খ্রীষ্টাব্দ"},
+ timezones: map[string]string{"EDT": "পূর্বাঞ্চলের দিবালোক সময়", "HNEG": "পূর্ব গ্রীনল্যান্ড মানক সময়", "HEEG": "পূর্ব গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "VET": "ভেনেজুয়েলা সময়", "HNT": "নিউফাউন্ডল্যান্ড মানক সময়", "HNPM": "সেন্ট পিয়ের ও মিকেলন মানক সময়", "CDT": "কেন্দ্রীয় দিবালোক সময়", "AEDT": "অস্ট্রেলীয় পূর্ব দিবালোক সময়", "MYT": "মালয়েশিয়া সময়", "JDT": "জাপান দিবালোক সময়", "AKST": "আলাস্কা মানক সময়", "SGT": "সিঙ্গাপুর মানক সময়", "HENOMX": "উত্তরপশ্চিম মেক্সিকোর দিনের সময়", "EAT": "পূর্ব আফ্রিকা সময়", "WIT": "পূর্ব ইন্দোনেশিয়া সময়", "OEZ": "পূর্ব ইউরোপীয় মানক সময়", "MESZ": "মধ্য ইউরোপীয় গ্রীষ্মকালীন সময়", "LHDT": "লর্ড হাওয়ে দিবালোক মসয়", "SAST": "দক্ষিণ আফ্রিকা মানক সময়", "WEZ": "পশ্চিম ইউরোপীয় মানক সময়", "HKT": "হং কং মানক সময়", "WART": "পশ্চিমি আর্জেনটিনার প্রমাণ সময়", "WARST": "পশ্চিমি আর্জেনটিনা গ্রীষ্মকালীন সময়", "ARST": "আর্জেন্টিনা গ্রীষ্মকালীন সময়", "BOT": "বোলিভিয়া সময়", "AKDT": "আলাস্কা দিবালোক সময়", "AST": "অতলান্তিক মানক সময়", "∅∅∅": "একর গ্রীষ্মকাল সময়", "UYST": "উরুগুয়ে গ্রীষ্মকালীন সময়", "AEST": "অস্ট্রেলীয় পূর্ব মানক সময়", "WAT": "পশ্চিম আফ্রিকা মানক সময়", "WAST": "পশ্চিম আফ্রিকা গ্রীষ্মকালীন সময়", "NZDT": "নিউজিল্যান্ড দিবালোক সময়", "HEOG": "পশ্চিম গ্রীনল্যান্ড গ্রীষ্মকালীন সময়", "HAST": "হাওয়াই-আলেউত মানক সময়", "PST": "প্রশান্ত মহাসাগরীয় অঞ্চলের মানক সময়", "HEPMX": "মেক্সিকান প্রশান্ত মহাসাগরীয় দিবালোক সময়", "WESZ": "পশ্চিম ইউরোপীয় গ্রীষ্মকালীন সময়", "EST": "পূর্বাঞ্চলের প্রমাণ সময়", "COT": "কোলোম্বিয়া মানক সময়", "UYT": "উরুগুয়ে মানক সময়", "ADT": "অতলান্তিক দিবালোক সময়", "WITA": "কেন্দ্রীয় ইন্দোনেশিয়া সময়", "TMT": "তুর্কমেনিস্তান মানক সময়", "HECU": "কিউবা দিবালোক সময়", "CHAST": "চ্যাথাম মানক সময়", "CHADT": "চ্যাথাম দিবালোক সময়", "AWST": "অস্ট্রেলীয় পশ্চিমি মানক সময়", "MST": "পার্বত্য অঞ্চলের প্রমাণ সময়", "JST": "জাপান মানক সময়", "MEZ": "মধ্য ইউরোপীয় মানক সময়", "LHST": "লর্ড হাওয়ে মানক মসয়", "ART": "আর্জেন্টিনা মানক সময়", "TMST": "তুর্কমেনিস্তান গ্রীষ্মকালীন সময়", "HADT": "হাওয়াই-আলেউত দিবালোক সময়", "WIB": "পশ্চিমী ইন্দোনেশিয়া সময়", "ACST": "অস্ট্রেলীয় কেন্দ্রীয় মানক সময়", "ACWDT": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি দিবালোক সময়", "IST": "ভারতীয় মানক সময়", "HEPM": "সেন্ট পিয়ের ও মিকেলন দিবালোক সময়", "HNNOMX": "উত্তরপশ্চিম মেক্সিকোর মানক সময়", "ACDT": "অস্ট্রেলীয় কেন্দ্রীয় দিবালোক সময়", "HNOG": "পশ্চিম গ্রীনল্যান্ড মানক সময়", "CLT": "চিলি মানক সময়", "CLST": "চিলি গ্রীষ্মকালীন সময়", "OESZ": "পূর্ব ইউরোপীয় গ্রীষ্মকালীন সময়", "GMT": "গ্রীনিচ মিন টাইম", "ChST": "চামেরো মানক সময়", "CST": "কেন্দ্রীয় মানক সময়", "PDT": "প্রশান্ত মহাসাগরীয় অঞ্চলের দিনের সময়", "HNPMX": "মেক্সিকান প্রশান্ত মহসাগরীয় মানক সময়", "HKST": "হং কং গ্রীষ্মকালীন সময়", "CAT": "মধ্য আফ্রিকা সময়", "COST": "কোলোম্বিয়া গ্রীষ্মকালীন সময়", "AWDT": "অস্ট্রেলীয় পশ্চিমি দিবালোক সময়", "BT": "ভুটান সময়", "NZST": "নিউজিল্যান্ড মানক সময়", "GYT": "গুয়ানা সময়", "MDT": "পার্বত্য অঞ্চলের দিনের সময়", "ACWST": "অস্ট্রেলীয় কেন্দ্রীয় পশ্চিমি মানক সময়", "SRT": "সুরিনাম সময়", "HNCU": "কিউবা মানক সময়", "GFT": "ফরাসি গায়ানা সময়", "ECT": "ইকুয়েডর সময়", "HAT": "নিউফাউন্ডল্যান্ড দিবালোক সময়"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bn *bn_IN) Locale() string {
+ return bn.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bn_IN'
+func (bn *bn_IN) PluralsCardinal() []locales.PluralRule {
+ return bn.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bn_IN'
+func (bn *bn_IN) PluralsOrdinal() []locales.PluralRule {
+ return bn.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bn_IN'
+func (bn *bn_IN) PluralsRange() []locales.PluralRule {
+ return bn.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bn_IN'
+func (bn *bn_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if (i == 0) || (n == 1) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bn_IN'
+func (bn *bn_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 5 || n == 7 || n == 8 || n == 9 || n == 10 {
+ return locales.PluralRuleOne
+ } else if n == 2 || n == 3 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bn_IN'
+func (bn *bn_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bn.CardinalPluralRule(num1, v1)
+ end := bn.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bn *bn_IN) MonthAbbreviated(month time.Month) string {
+ return bn.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bn *bn_IN) MonthsAbbreviated() []string {
+ return bn.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bn *bn_IN) MonthNarrow(month time.Month) string {
+ return bn.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bn *bn_IN) MonthsNarrow() []string {
+ return bn.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bn *bn_IN) MonthWide(month time.Month) string {
+ return bn.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bn *bn_IN) MonthsWide() []string {
+ return bn.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bn *bn_IN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bn.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bn *bn_IN) WeekdaysAbbreviated() []string {
+ return bn.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bn *bn_IN) WeekdayNarrow(weekday time.Weekday) string {
+ return bn.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bn *bn_IN) WeekdaysNarrow() []string {
+ return bn.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bn *bn_IN) WeekdayShort(weekday time.Weekday) string {
+ return bn.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bn *bn_IN) WeekdaysShort() []string {
+ return bn.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bn *bn_IN) WeekdayWide(weekday time.Weekday) string {
+ return bn.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bn *bn_IN) WeekdaysWide() []string {
+ return bn.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bn *bn_IN) Decimal() string {
+ return bn.decimal
+}
+
+// Group returns the group of number
+func (bn *bn_IN) Group() string {
+ return bn.group
+}
+
+// Group returns the minus sign of number
+func (bn *bn_IN) Minus() string {
+ return bn.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bn_IN' and handles both Whole and Real numbers based on 'v'
+func (bn *bn_IN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bn_IN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bn *bn_IN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bn.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bn_IN'
+func (bn *bn_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bn.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bn_IN'
+// in accounting notation.
+func (bn *bn_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bn.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bn.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, bn.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bn.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bn.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bn.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, bn.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bn_IN'
+func (bn *bn_IN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bn.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bn.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bn.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bn.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bn_IN/bn_IN_test.go b/vendor/github.com/go-playground/locales/bn_IN/bn_IN_test.go
new file mode 100644
index 000000000..bdee61d9d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bn_IN/bn_IN_test.go
@@ -0,0 +1,1120 @@
+package bn_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bn_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bo/bo.go b/vendor/github.com/go-playground/locales/bo/bo.go
new file mode 100644
index 000000000..60c064f5a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo/bo.go
@@ -0,0 +1,643 @@
+package bo
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bo struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bo' locale
+func New() locales.Translator {
+ return &bo{
+ locale: "bo",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "ཟླ་༡", "ཟླ་༢", "ཟླ་༣", "ཟླ་༤", "ཟླ་༥", "ཟླ་༦", "ཟླ་༧", "ཟླ་༨", "ཟླ་༩", "ཟླ་༡༠", "ཟླ་༡༡", "ཟླ་༡༢"},
+ monthsWide: []string{"", "ཟླ་བ་དང་པོ", "ཟླ་བ་གཉིས་པ", "ཟླ་བ་གསུམ་པ", "ཟླ་བ་བཞི་པ", "ཟླ་བ་ལྔ་པ", "ཟླ་བ་དྲུག་པ", "ཟླ་བ་བདུན་པ", "ཟླ་བ་བརྒྱད་པ", "ཟླ་བ་དགུ་པ", "ཟླ་བ་བཅུ་པ", "ཟླ་བ་བཅུ་གཅིག་པ", "ཟླ་བ་བཅུ་གཉིས་པ"},
+ daysAbbreviated: []string{"ཉི་མ་", "ཟླ་བ་", "མིག་དམར་", "ལྷག་པ་", "ཕུར་བུ་", "པ་སངས་", "སྤེན་པ་"},
+ daysNarrow: []string{"ཉི", "ཟླ", "མིག", "ལྷག", "ཕུར", "སངས", "སྤེན"},
+ daysWide: []string{"གཟའ་ཉི་མ་", "གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་"},
+ periodsAbbreviated: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ periodsWide: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"WESZ": "WESZ", "MEZ": "MEZ", "HNT": "HNT", "VET": "VET", "OESZ": "OESZ", "AST": "AST", "WAT": "WAT", "AEDT": "AEDT", "MYT": "MYT", "HEPM": "HEPM", "ARST": "ARST", "UYT": "UYT", "PDT": "PDT", "HEEG": "HEEG", "HADT": "HADT", "CHADT": "CHADT", "SAST": "SAST", "HENOMX": "HENOMX", "ADT": "ADT", "HNOG": "HNOG", "MESZ": "MESZ", "LHDT": "LHDT", "CAT": "CAT", "WIT": "WIT", "HECU": "HECU", "NZST": "NZST", "LHST": "LHST", "JDT": "JDT", "HNEG": "HNEG", "IST": "IST", "EAT": "EAT", "GYT": "GYT", "UYST": "UYST", "CDT": "CDT", "WIB": "WIB", "ACDT": "ACDT", "TMT": "TMT", "NZDT": "NZDT", "GFT": "GFT", "JST": "JST", "EST": "EST", "HKT": "HKT", "COST": "COST", "CHAST": "CHAST", "WEZ": "WEZ", "WARST": "WARST", "HAT": "HAT", "WAST": "WAST", "AKST": "AKST", "SGT": "SGT", "EDT": "EDT", "ACWST": "ACWST", "PST": "PST", "HNPMX": "HNPMX", "HEPMX": "HEPMX", "HNCU": "HNCU", "SRT": "SRT", "TMST": "TMST", "HEOG": "HEOG", "WITA": "WITA", "AEST": "AEST", "AKDT": "AKDT", "ACST": "ACST", "∅∅∅": "∅∅∅", "CLT": "CLT", "HKST": "HKST", "ART": "ART", "MDT": "MDT", "BT": "BT", "AWST": "AWST", "MST": "MST", "ACWDT": "ACWDT", "OEZ": "OEZ", "HAST": "HAST", "GMT": "GMT", "HNNOMX": "HNNOMX", "CLST": "CLST", "COT": "COT", "AWDT": "AWDT", "ECT": "ECT", "WART": "WART", "HNPM": "HNPM", "ChST": "ChST", "CST": "CST", "BOT": "BOT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bo *bo) Locale() string {
+ return bo.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bo'
+func (bo *bo) PluralsCardinal() []locales.PluralRule {
+ return bo.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bo'
+func (bo *bo) PluralsOrdinal() []locales.PluralRule {
+ return bo.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bo'
+func (bo *bo) PluralsRange() []locales.PluralRule {
+ return bo.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bo'
+func (bo *bo) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bo'
+func (bo *bo) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bo'
+func (bo *bo) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bo *bo) MonthAbbreviated(month time.Month) string {
+ return bo.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bo *bo) MonthsAbbreviated() []string {
+ return bo.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bo *bo) MonthNarrow(month time.Month) string {
+ return bo.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bo *bo) MonthsNarrow() []string {
+ return nil
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bo *bo) MonthWide(month time.Month) string {
+ return bo.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bo *bo) MonthsWide() []string {
+ return bo.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bo *bo) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bo.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bo *bo) WeekdaysAbbreviated() []string {
+ return bo.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bo *bo) WeekdayNarrow(weekday time.Weekday) string {
+ return bo.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bo *bo) WeekdaysNarrow() []string {
+ return bo.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bo *bo) WeekdayShort(weekday time.Weekday) string {
+ return bo.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bo *bo) WeekdaysShort() []string {
+ return bo.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bo *bo) WeekdayWide(weekday time.Weekday) string {
+ return bo.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bo *bo) WeekdaysWide() []string {
+ return bo.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bo *bo) Decimal() string {
+ return bo.decimal
+}
+
+// Group returns the group of number
+func (bo *bo) Group() string {
+ return bo.group
+}
+
+// Group returns the minus sign of number
+func (bo *bo) Minus() string {
+ return bo.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bo' and handles both Whole and Real numbers based on 'v'
+func (bo *bo) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bo' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bo *bo) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bo.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bo'
+func (bo *bo) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bo'
+// in accounting notation.
+func (bo *bo) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyNegativePrefix[j])
+ }
+
+ b = append(b, bo.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bo'
+func (bo *bo) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bo'
+func (bo *bo) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b}...)
+ b = append(b, bo.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bo'
+func (bo *bo) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bo'
+func (bo *bo) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, bo.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bo'
+func (bo *bo) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bo'
+func (bo *bo) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bo'
+func (bo *bo) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bo'
+func (bo *bo) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bo.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bo/bo_test.go b/vendor/github.com/go-playground/locales/bo/bo_test.go
new file mode 100644
index 000000000..33fcc1bb3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo/bo_test.go
@@ -0,0 +1,1120 @@
+package bo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bo_CN/bo_CN.go b/vendor/github.com/go-playground/locales/bo_CN/bo_CN.go
new file mode 100644
index 000000000..8a2fe186c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo_CN/bo_CN.go
@@ -0,0 +1,643 @@
+package bo_CN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bo_CN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bo_CN' locale
+func New() locales.Translator {
+ return &bo_CN{
+ locale: "bo_CN",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "ཟླ་༡", "ཟླ་༢", "ཟླ་༣", "ཟླ་༤", "ཟླ་༥", "ཟླ་༦", "ཟླ་༧", "ཟླ་༨", "ཟླ་༩", "ཟླ་༡༠", "ཟླ་༡༡", "ཟླ་༡༢"},
+ monthsWide: []string{"", "ཟླ་བ་དང་པོ", "ཟླ་བ་གཉིས་པ", "ཟླ་བ་གསུམ་པ", "ཟླ་བ་བཞི་པ", "ཟླ་བ་ལྔ་པ", "ཟླ་བ་དྲུག་པ", "ཟླ་བ་བདུན་པ", "ཟླ་བ་བརྒྱད་པ", "ཟླ་བ་དགུ་པ", "ཟླ་བ་བཅུ་པ", "ཟླ་བ་བཅུ་གཅིག་པ", "ཟླ་བ་བཅུ་གཉིས་པ"},
+ daysAbbreviated: []string{"ཉི་མ་", "ཟླ་བ་", "མིག་དམར་", "ལྷག་པ་", "ཕུར་བུ་", "པ་སངས་", "སྤེན་པ་"},
+ daysNarrow: []string{"ཉི", "ཟླ", "མིག", "ལྷག", "ཕུར", "སངས", "སྤེན"},
+ daysWide: []string{"གཟའ་ཉི་མ་", "གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་"},
+ periodsAbbreviated: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ periodsWide: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"WESZ": "WESZ", "SRT": "SRT", "OEZ": "OEZ", "HECU": "HECU", "ACST": "ACST", "CAT": "CAT", "GMT": "GMT", "CHAST": "CHAST", "HNPMX": "HNPMX", "AEDT": "AEDT", "EST": "EST", "HKST": "HKST", "WART": "WART", "WITA": "WITA", "CLST": "CLST", "AST": "AST", "WEZ": "WEZ", "WIT": "WIT", "MDT": "MDT", "HNEG": "HNEG", "CDT": "CDT", "ECT": "ECT", "HEOG": "HEOG", "HNT": "HNT", "VET": "VET", "HNNOMX": "HNNOMX", "TMT": "TMT", "MST": "MST", "ADT": "ADT", "WAT": "WAT", "COST": "COST", "ACWST": "ACWST", "HEEG": "HEEG", "WARST": "WARST", "HEPM": "HEPM", "CLT": "CLT", "JST": "JST", "ACWDT": "ACWDT", "MESZ": "MESZ", "HAST": "HAST", "HADT": "HADT", "UYT": "UYT", "WAST": "WAST", "BT": "BT", "NZST": "NZST", "ARST": "ARST", "COT": "COT", "PDT": "PDT", "HNOG": "HNOG", "MEZ": "MEZ", "LHST": "LHST", "HENOMX": "HENOMX", "GYT": "GYT", "LHDT": "LHDT", "HNPM": "HNPM", "TMST": "TMST", "EAT": "EAT", "CHADT": "CHADT", "HNCU": "HNCU", "PST": "PST", "BOT": "BOT", "GFT": "GFT", "AKST": "AKST", "IST": "IST", "OESZ": "OESZ", "UYST": "UYST", "AEST": "AEST", "WIB": "WIB", "MYT": "MYT", "NZDT": "NZDT", "EDT": "EDT", "HAT": "HAT", "HEPMX": "HEPMX", "SAST": "SAST", "ACDT": "ACDT", "ART": "ART", "ChST": "ChST", "AWST": "AWST", "AWDT": "AWDT", "CST": "CST", "∅∅∅": "∅∅∅", "JDT": "JDT", "AKDT": "AKDT", "SGT": "SGT", "HKT": "HKT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bo *bo_CN) Locale() string {
+ return bo.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bo_CN'
+func (bo *bo_CN) PluralsCardinal() []locales.PluralRule {
+ return bo.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bo_CN'
+func (bo *bo_CN) PluralsOrdinal() []locales.PluralRule {
+ return bo.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bo_CN'
+func (bo *bo_CN) PluralsRange() []locales.PluralRule {
+ return bo.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bo_CN'
+func (bo *bo_CN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bo_CN'
+func (bo *bo_CN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bo_CN'
+func (bo *bo_CN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bo *bo_CN) MonthAbbreviated(month time.Month) string {
+ return bo.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bo *bo_CN) MonthsAbbreviated() []string {
+ return bo.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bo *bo_CN) MonthNarrow(month time.Month) string {
+ return bo.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bo *bo_CN) MonthsNarrow() []string {
+ return nil
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bo *bo_CN) MonthWide(month time.Month) string {
+ return bo.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bo *bo_CN) MonthsWide() []string {
+ return bo.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bo *bo_CN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bo.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bo *bo_CN) WeekdaysAbbreviated() []string {
+ return bo.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bo *bo_CN) WeekdayNarrow(weekday time.Weekday) string {
+ return bo.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bo *bo_CN) WeekdaysNarrow() []string {
+ return bo.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bo *bo_CN) WeekdayShort(weekday time.Weekday) string {
+ return bo.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bo *bo_CN) WeekdaysShort() []string {
+ return bo.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bo *bo_CN) WeekdayWide(weekday time.Weekday) string {
+ return bo.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bo *bo_CN) WeekdaysWide() []string {
+ return bo.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bo *bo_CN) Decimal() string {
+ return bo.decimal
+}
+
+// Group returns the group of number
+func (bo *bo_CN) Group() string {
+ return bo.group
+}
+
+// Group returns the minus sign of number
+func (bo *bo_CN) Minus() string {
+ return bo.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bo_CN' and handles both Whole and Real numbers based on 'v'
+func (bo *bo_CN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bo_CN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bo *bo_CN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bo.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bo_CN'
+func (bo *bo_CN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bo_CN'
+// in accounting notation.
+func (bo *bo_CN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyNegativePrefix[j])
+ }
+
+ b = append(b, bo.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b}...)
+ b = append(b, bo.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, bo.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bo_CN'
+func (bo *bo_CN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bo.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bo_CN/bo_CN_test.go b/vendor/github.com/go-playground/locales/bo_CN/bo_CN_test.go
new file mode 100644
index 000000000..f4e143a87
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo_CN/bo_CN_test.go
@@ -0,0 +1,1120 @@
+package bo_CN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo_CN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bo_IN/bo_IN.go b/vendor/github.com/go-playground/locales/bo_IN/bo_IN.go
new file mode 100644
index 000000000..b190d4f8b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo_IN/bo_IN.go
@@ -0,0 +1,643 @@
+package bo_IN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bo_IN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bo_IN' locale
+func New() locales.Translator {
+ return &bo_IN{
+ locale: "bo_IN",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "ཟླ་༡", "ཟླ་༢", "ཟླ་༣", "ཟླ་༤", "ཟླ་༥", "ཟླ་༦", "ཟླ་༧", "ཟླ་༨", "ཟླ་༩", "ཟླ་༡༠", "ཟླ་༡༡", "ཟླ་༡༢"},
+ monthsWide: []string{"", "ཟླ་བ་དང་པོ", "ཟླ་བ་གཉིས་པ", "ཟླ་བ་གསུམ་པ", "ཟླ་བ་བཞི་པ", "ཟླ་བ་ལྔ་པ", "ཟླ་བ་དྲུག་པ", "ཟླ་བ་བདུན་པ", "ཟླ་བ་བརྒྱད་པ", "ཟླ་བ་དགུ་པ", "ཟླ་བ་བཅུ་པ", "ཟླ་བ་བཅུ་གཅིག་པ", "ཟླ་བ་བཅུ་གཉིས་པ"},
+ daysAbbreviated: []string{"ཉི་མ་", "ཟླ་བ་", "མིག་དམར་", "ལྷག་པ་", "ཕུར་བུ་", "པ་སངས་", "སྤེན་པ་"},
+ daysNarrow: []string{"ཉི", "ཟླ", "མིག", "ལྷག", "ཕུར", "སངས", "སྤེན"},
+ daysWide: []string{"གཟའ་ཉི་མ་", "གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་"},
+ periodsAbbreviated: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ periodsWide: []string{"སྔ་དྲོ་", "ཕྱི་དྲོ་"},
+ erasAbbreviated: []string{"སྤྱི་ལོ་སྔོན་", "སྤྱི་ལོ་"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"AST": "AST", "EST": "EST", "OESZ": "OESZ", "HNPMX": "HNPMX", "MDT": "MDT", "HNOG": "HNOG", "UYT": "UYT", "SGT": "SGT", "ARST": "ARST", "ChST": "ChST", "CHADT": "CHADT", "NZDT": "NZDT", "MYT": "MYT", "EAT": "EAT", "CLT": "CLT", "TMST": "TMST", "HECU": "HECU", "SAST": "SAST", "HKST": "HKST", "HNT": "HNT", "LHDT": "LHDT", "CLST": "CLST", "COT": "COT", "GYT": "GYT", "CST": "CST", "ACST": "ACST", "ACWST": "ACWST", "HKT": "HKT", "GMT": "GMT", "CDT": "CDT", "WAT": "WAT", "EDT": "EDT", "CAT": "CAT", "HEEG": "HEEG", "HENOMX": "HENOMX", "WIT": "WIT", "AEST": "AEST", "WIB": "WIB", "SRT": "SRT", "HADT": "HADT", "ART": "ART", "WEZ": "WEZ", "WESZ": "WESZ", "WARST": "WARST", "HEPM": "HEPM", "WITA": "WITA", "UYST": "UYST", "AEDT": "AEDT", "JST": "JST", "IST": "IST", "WART": "WART", "ACWDT": "ACWDT", "OEZ": "OEZ", "COST": "COST", "HNCU": "HNCU", "∅∅∅": "∅∅∅", "JDT": "JDT", "ECT": "ECT", "ACDT": "ACDT", "HNEG": "HNEG", "MESZ": "MESZ", "HNPM": "HNPM", "AWDT": "AWDT", "MST": "MST", "BT": "BT", "AKST": "AKST", "PST": "PST", "NZST": "NZST", "HAST": "HAST", "HAT": "HAT", "VET": "VET", "TMT": "TMT", "PDT": "PDT", "AWST": "AWST", "AKDT": "AKDT", "MEZ": "MEZ", "BOT": "BOT", "GFT": "GFT", "HEOG": "HEOG", "LHST": "LHST", "CHAST": "CHAST", "HEPMX": "HEPMX", "ADT": "ADT", "WAST": "WAST", "HNNOMX": "HNNOMX"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bo *bo_IN) Locale() string {
+ return bo.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bo_IN'
+func (bo *bo_IN) PluralsCardinal() []locales.PluralRule {
+ return bo.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bo_IN'
+func (bo *bo_IN) PluralsOrdinal() []locales.PluralRule {
+ return bo.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bo_IN'
+func (bo *bo_IN) PluralsRange() []locales.PluralRule {
+ return bo.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bo_IN'
+func (bo *bo_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bo_IN'
+func (bo *bo_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bo_IN'
+func (bo *bo_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bo *bo_IN) MonthAbbreviated(month time.Month) string {
+ return bo.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bo *bo_IN) MonthsAbbreviated() []string {
+ return bo.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bo *bo_IN) MonthNarrow(month time.Month) string {
+ return bo.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bo *bo_IN) MonthsNarrow() []string {
+ return nil
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bo *bo_IN) MonthWide(month time.Month) string {
+ return bo.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bo *bo_IN) MonthsWide() []string {
+ return bo.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bo *bo_IN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bo.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bo *bo_IN) WeekdaysAbbreviated() []string {
+ return bo.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bo *bo_IN) WeekdayNarrow(weekday time.Weekday) string {
+ return bo.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bo *bo_IN) WeekdaysNarrow() []string {
+ return bo.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bo *bo_IN) WeekdayShort(weekday time.Weekday) string {
+ return bo.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bo *bo_IN) WeekdaysShort() []string {
+ return bo.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bo *bo_IN) WeekdayWide(weekday time.Weekday) string {
+ return bo.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bo *bo_IN) WeekdaysWide() []string {
+ return bo.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bo *bo_IN) Decimal() string {
+ return bo.decimal
+}
+
+// Group returns the group of number
+func (bo *bo_IN) Group() string {
+ return bo.group
+}
+
+// Group returns the minus sign of number
+func (bo *bo_IN) Minus() string {
+ return bo.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bo_IN' and handles both Whole and Real numbers based on 'v'
+func (bo *bo_IN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bo_IN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bo *bo_IN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bo.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bo_IN'
+func (bo *bo_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, bo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bo_IN'
+// in accounting notation.
+func (bo *bo_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bo.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyNegativePrefix[j])
+ }
+
+ b = append(b, bo.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(bo.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, bo.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b}...)
+ b = append(b, bo.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, bo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xe0, 0xbd, 0xa0, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, bo.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bo_IN'
+func (bo *bo_IN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, bo.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, bo.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bo.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bo_IN/bo_IN_test.go b/vendor/github.com/go-playground/locales/bo_IN/bo_IN_test.go
new file mode 100644
index 000000000..b15754069
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bo_IN/bo_IN_test.go
@@ -0,0 +1,1120 @@
+package bo_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bo_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/br/br.go b/vendor/github.com/go-playground/locales/br/br.go
new file mode 100644
index 000000000..b2c3664ca
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/br/br.go
@@ -0,0 +1,623 @@
+package br
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type br struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'br' locale
+func New() locales.Translator {
+ return &br{
+ locale: "br",
+ pluralsCardinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "$A", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "$CA", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£ RU", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "$ HK", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "$ ZN", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "$ SU", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Gen.", "Cʼhwe.", "Meur.", "Ebr.", "Mae", "Mezh.", "Goue.", "Eost", "Gwen.", "Here", "Du", "Kzu."},
+ monthsNarrow: []string{"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"},
+ monthsWide: []string{"", "Genver", "Cʼhwevrer", "Meurzh", "Ebrel", "Mae", "Mezheven", "Gouere", "Eost", "Gwengolo", "Here", "Du", "Kerzu"},
+ daysAbbreviated: []string{"Sul", "Lun", "Meu.", "Mer.", "Yaou", "Gwe.", "Sad."},
+ daysNarrow: []string{"Su", "L", "Mz", "Mc", "Y", "G", "Sa"},
+ daysShort: []string{"Sul", "Lun", "Meu.", "Mer.", "Yaou", "Gwe.", "Sad."},
+ daysWide: []string{"Sul", "Lun", "Meurzh", "Mercʼher", "Yaou", "Gwener", "Sadorn"},
+ periodsAbbreviated: []string{"A.M.", "G.M."},
+ periodsNarrow: []string{"am", "gm"},
+ periodsWide: []string{"A.M.", "G.M."},
+ erasAbbreviated: []string{"a-raok J.K.", "goude J.K."},
+ erasNarrow: []string{"a-raok J.K.", "goude J.K."},
+ erasWide: []string{"a-raok Jezuz-Krist", "goude Jezuz-Krist"},
+ timezones: map[string]string{"ADT": "ADT", "ECT": "eur Ecuador", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "HNEG": "eur cʼhoañv Greunland ar Reter", "WITA": "WITA", "HENOMX": "eur hañv Gwalarn Mecʼhiko", "OEZ": "eur cʼhoañv Europa ar Reter", "HAST": "HAST", "HNCU": "eur cʼhoañv Kuba", "AEDT": "eur hañv Aostralia ar Reter", "HEOG": "eur hañv Greunland ar Cʼhornôg", "ACST": "eur cʼhoañv Kreizaostralia", "MESZ": "eur hañv Kreizeuropa", "CAT": "eur Kreizafrika", "COST": "eur hañv Kolombia", "HNPMX": "HNPMX", "EST": "eur cʼhoañv ar Reter", "EAT": "eur Afrika ar Reter", "HEPMX": "HEPMX", "MDT": "eur hañv ar Menezioù", "SGT": "eur cʼhoañv Singapour", "LHST": "LHST", "HNNOMX": "eur cʼhoañv Gwalarn Mecʼhiko", "SRT": "eur Surinam", "CLST": "eur hañv Chile", "OESZ": "eur hañv Europa ar Reter", "ARST": "eur hañv Arcʼhantina", "PDT": "PDT", "AEST": "eur cʼhoañv Aostralia ar Reter", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "WAST": "eur hañv Afrika ar Cʼhornôg", "JST": "eur cʼhoañv Japan", "BT": "eur Bhoutan", "NZDT": "eur hañv Zeland-Nevez", "MYT": "eur Malaysia", "CHADT": "eur hañv Chatham", "MEZ": "eur cʼhoañv Kreizeuropa", "LHDT": "LHDT", "∅∅∅": "eur hañv Brasília", "CDT": "CDT", "PST": "PST", "WESZ": "eur hañv Europa ar Cʼhornôg", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "HNT": "eur cʼhoañv Newfoundland", "VET": "eur Venezuela", "WIT": "eur Indonezia ar Reter", "JDT": "eur hañv Japan", "AKDT": "eur hañv Alaska", "WIB": "eur Indonezia ar Cʼhornôg", "HNOG": "eur cʼhoañv Greunland ar Cʼhornôg", "HAT": "eur hañv Newfoundland", "HADT": "HADT", "GMT": "Amzer keitat Greenwich (AKG)", "ChST": "ChST", "CST": "CST", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "NZST": "eur cʼhoañv Zeland-Nevez", "HNPM": "eur cʼhoañv Sant-Pêr-ha-Mikelon", "CLT": "eur cʼhoañv Chile", "GYT": "eur Guyana", "UYT": "eur cʼhoañv Uruguay", "UYST": "eur hañv Uruguay", "AST": "AST", "COT": "eur cʼhoañv Kolombia", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "EDT": "eur hañv ar Reter", "ACDT": "eur hañv Kreizaostralia", "HEEG": "eur hañv Greunland ar Reter", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "CHAST": "eur cʼhoañv Chatham", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "GFT": "eur Gwiana cʼhall", "AKST": "eur cʼhoañv Alaska", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "HKT": "eur cʼhoañv Hong Kong", "IST": "eur cʼhoañv India", "HEPM": "eur hañv Sant-Pêr-ha-Mikelon", "HECU": "eur hañv Kuba", "MST": "eur cʼhoañv ar Menezioù", "SAST": "eur cʼhoañv Suafrika", "HKST": "eur hañv Hong Kong", "ART": "eur cʼhoañv Arcʼhantina", "BOT": "eur Bolivia", "TMT": "eur cʼhoañv Turkmenistan", "TMST": "eur hañv Turkmenistan"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (br *br) Locale() string {
+ return br.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'br'
+func (br *br) PluralsCardinal() []locales.PluralRule {
+ return br.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'br'
+func (br *br) PluralsOrdinal() []locales.PluralRule {
+ return br.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'br'
+func (br *br) PluralsRange() []locales.PluralRule {
+ return br.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'br'
+func (br *br) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod100 := math.Mod(n, 100)
+ nMod1000000 := math.Mod(n, 1000000)
+ nMod10 := math.Mod(n, 10)
+
+ if nMod10 == 1 && (nMod100 != 11 && nMod100 != 71 && nMod100 != 91) {
+ return locales.PluralRuleOne
+ } else if nMod10 == 2 && (nMod100 != 12 && nMod100 != 72 && nMod100 != 92) {
+ return locales.PluralRuleTwo
+ } else if nMod10 >= 3 && nMod10 <= 4 && (nMod10 == 9) && (nMod100 < 10 || nMod100 > 19) || (nMod100 < 70 || nMod100 > 79) || (nMod100 < 90 || nMod100 > 99) {
+ return locales.PluralRuleFew
+ } else if n != 0 && nMod1000000 == 0 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'br'
+func (br *br) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'br'
+func (br *br) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (br *br) MonthAbbreviated(month time.Month) string {
+ return br.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (br *br) MonthsAbbreviated() []string {
+ return br.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (br *br) MonthNarrow(month time.Month) string {
+ return br.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (br *br) MonthsNarrow() []string {
+ return br.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (br *br) MonthWide(month time.Month) string {
+ return br.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (br *br) MonthsWide() []string {
+ return br.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (br *br) WeekdayAbbreviated(weekday time.Weekday) string {
+ return br.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (br *br) WeekdaysAbbreviated() []string {
+ return br.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (br *br) WeekdayNarrow(weekday time.Weekday) string {
+ return br.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (br *br) WeekdaysNarrow() []string {
+ return br.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (br *br) WeekdayShort(weekday time.Weekday) string {
+ return br.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (br *br) WeekdaysShort() []string {
+ return br.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (br *br) WeekdayWide(weekday time.Weekday) string {
+ return br.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (br *br) WeekdaysWide() []string {
+ return br.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (br *br) Decimal() string {
+ return br.decimal
+}
+
+// Group returns the group of number
+func (br *br) Group() string {
+ return br.group
+}
+
+// Group returns the minus sign of number
+func (br *br) Minus() string {
+ return br.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'br' and handles both Whole and Real numbers based on 'v'
+func (br *br) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'br' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (br *br) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, br.percentSuffix...)
+
+ b = append(b, br.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'br'
+func (br *br) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := br.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, br.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, br.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'br'
+// in accounting notation.
+func (br *br) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := br.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, br.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, br.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, br.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, br.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'br'
+func (br *br) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'br'
+func (br *br) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'br'
+func (br *br) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'br'
+func (br *br) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, br.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'br'
+func (br *br) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'br'
+func (br *br) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'br'
+func (br *br) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'br'
+func (br *br) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := br.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/br/br_test.go b/vendor/github.com/go-playground/locales/br/br_test.go
new file mode 100644
index 000000000..f19012b0c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/br/br_test.go
@@ -0,0 +1,1120 @@
+package br
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "br"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/br_FR/br_FR.go b/vendor/github.com/go-playground/locales/br_FR/br_FR.go
new file mode 100644
index 000000000..620b87ba4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/br_FR/br_FR.go
@@ -0,0 +1,623 @@
+package br_FR
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type br_FR struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'br_FR' locale
+func New() locales.Translator {
+ return &br_FR{
+ locale: "br_FR",
+ pluralsCardinal: []locales.PluralRule{2, 3, 4, 5, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Gen.", "Cʼhwe.", "Meur.", "Ebr.", "Mae", "Mezh.", "Goue.", "Eost", "Gwen.", "Here", "Du", "Kzu."},
+ monthsNarrow: []string{"", "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"},
+ monthsWide: []string{"", "Genver", "Cʼhwevrer", "Meurzh", "Ebrel", "Mae", "Mezheven", "Gouere", "Eost", "Gwengolo", "Here", "Du", "Kerzu"},
+ daysAbbreviated: []string{"Sul", "Lun", "Meu.", "Mer.", "Yaou", "Gwe.", "Sad."},
+ daysNarrow: []string{"Su", "L", "Mz", "Mc", "Y", "G", "Sa"},
+ daysShort: []string{"Sul", "Lun", "Meu.", "Mer.", "Yaou", "Gwe.", "Sad."},
+ daysWide: []string{"Sul", "Lun", "Meurzh", "Mercʼher", "Yaou", "Gwener", "Sadorn"},
+ periodsAbbreviated: []string{"A.M.", "G.M."},
+ periodsNarrow: []string{"am", "gm"},
+ periodsWide: []string{"A.M.", "G.M."},
+ erasAbbreviated: []string{"a-raok J.K.", "goude J.K."},
+ erasNarrow: []string{"a-raok J.K.", "goude J.K."},
+ erasWide: []string{"a-raok Jezuz-Krist", "goude Jezuz-Krist"},
+ timezones: map[string]string{"CAT": "eur Kreizafrika", "COT": "eur cʼhoañv Kolombia", "EDT": "eur hañv ar Reter", "ACST": "eur cʼhoañv Kreizaostralia", "LHST": "LHST", "CHADT": "eur hañv Chatham", "PST": "PST", "MDT": "eur hañv ar Menezioù", "WART": "eur cʼhoañv Arcʼhantina ar Cʼhornôg", "PDT": "PDT", "AWDT": "eur hañv Aostralia ar Cʼhornôg", "GFT": "eur Gwiana cʼhall", "NZST": "eur cʼhoañv Zeland-Nevez", "HNOG": "eur cʼhoañv Greunland ar Cʼhornôg", "OEZ": "eur cʼhoañv Europa ar Reter", "ARST": "eur hañv Arcʼhantina", "CST": "CST", "OESZ": "eur hañv Europa ar Reter", "ART": "eur cʼhoañv Arcʼhantina", "AEDT": "eur hañv Aostralia ar Reter", "ACWST": "eur cʼhoañv Kreizaostralia ar Cʼhornôg", "SRT": "eur Surinam", "COST": "eur hañv Kolombia", "∅∅∅": "eur hañv an Amazon", "HADT": "HADT", "SAST": "eur cʼhoañv Suafrika", "EST": "eur cʼhoañv ar Reter", "VET": "eur Venezuela", "HNCU": "eur cʼhoañv Kuba", "HKST": "eur hañv Hong Kong", "HNT": "eur cʼhoañv Newfoundland", "EAT": "eur Afrika ar Reter", "CLST": "eur hañv Chile", "GMT": "Amzer keitat Greenwich (AKG)", "MST": "eur cʼhoañv ar Menezioù", "WEZ": "eur cʼhoañv Europa ar Cʼhornôg", "WESZ": "eur hañv Europa ar Cʼhornôg", "ACWDT": "eur hañv Kreizaostralia ar Cʼhornôg", "TMST": "eur hañv Turkmenistan", "GYT": "eur Guyana", "ChST": "ChST", "BT": "eur Bhoutan", "NZDT": "eur hañv Zeland-Nevez", "AKDT": "eur hañv Alaska", "WITA": "WITA", "TMT": "eur cʼhoañv Turkmenistan", "HAST": "HAST", "HECU": "eur hañv Kuba", "CDT": "CDT", "ECT": "eur Ecuador", "HNPMX": "HNPMX", "HEPMX": "HEPMX", "AST": "AST", "AEST": "eur cʼhoañv Aostralia ar Reter", "AKST": "eur cʼhoañv Alaska", "SGT": "eur cʼhoañv Singapour", "HEOG": "eur hañv Greunland ar Cʼhornôg", "ACDT": "eur hañv Kreizaostralia", "MEZ": "eur cʼhoañv Kreizeuropa", "HENOMX": "eur hañv Gwalarn Mecʼhiko", "WIT": "eur Indonezia ar Reter", "CLT": "eur cʼhoañv Chile", "UYST": "eur hañv Uruguay", "CHAST": "eur cʼhoañv Chatham", "WAST": "eur hañv Afrika ar Cʼhornôg", "HNEG": "eur cʼhoañv Greunland ar Reter", "HEEG": "eur hañv Greunland ar Reter", "HNPM": "eur cʼhoañv Sant-Pêr-ha-Mikelon", "ADT": "ADT", "JST": "eur cʼhoañv Japan", "MYT": "eur Malaysia", "MESZ": "eur hañv Kreizeuropa", "WARST": "eur hañv Arcʼhantina ar Cʼhornôg", "HNNOMX": "eur cʼhoañv Gwalarn Mecʼhiko", "WAT": "eur cʼhoañv Afrika ar Cʼhornôg", "BOT": "eur Bolivia", "JDT": "eur hañv Japan", "HKT": "eur cʼhoañv Hong Kong", "IST": "eur cʼhoañv India", "LHDT": "LHDT", "HAT": "eur hañv Newfoundland", "UYT": "eur cʼhoañv Uruguay", "HEPM": "eur hañv Sant-Pêr-ha-Mikelon", "AWST": "eur cʼhoañv Aostralia ar Cʼhornôg", "WIB": "eur Indonezia ar Cʼhornôg"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (br *br_FR) Locale() string {
+ return br.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'br_FR'
+func (br *br_FR) PluralsCardinal() []locales.PluralRule {
+ return br.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'br_FR'
+func (br *br_FR) PluralsOrdinal() []locales.PluralRule {
+ return br.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'br_FR'
+func (br *br_FR) PluralsRange() []locales.PluralRule {
+ return br.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'br_FR'
+func (br *br_FR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ nMod1000000 := math.Mod(n, 1000000)
+ nMod10 := math.Mod(n, 10)
+ nMod100 := math.Mod(n, 100)
+
+ if nMod10 == 1 && (nMod100 != 11 && nMod100 != 71 && nMod100 != 91) {
+ return locales.PluralRuleOne
+ } else if nMod10 == 2 && (nMod100 != 12 && nMod100 != 72 && nMod100 != 92) {
+ return locales.PluralRuleTwo
+ } else if nMod10 >= 3 && nMod10 <= 4 && (nMod10 == 9) && (nMod100 < 10 || nMod100 > 19) || (nMod100 < 70 || nMod100 > 79) || (nMod100 < 90 || nMod100 > 99) {
+ return locales.PluralRuleFew
+ } else if n != 0 && nMod1000000 == 0 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'br_FR'
+func (br *br_FR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'br_FR'
+func (br *br_FR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (br *br_FR) MonthAbbreviated(month time.Month) string {
+ return br.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (br *br_FR) MonthsAbbreviated() []string {
+ return br.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (br *br_FR) MonthNarrow(month time.Month) string {
+ return br.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (br *br_FR) MonthsNarrow() []string {
+ return br.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (br *br_FR) MonthWide(month time.Month) string {
+ return br.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (br *br_FR) MonthsWide() []string {
+ return br.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (br *br_FR) WeekdayAbbreviated(weekday time.Weekday) string {
+ return br.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (br *br_FR) WeekdaysAbbreviated() []string {
+ return br.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (br *br_FR) WeekdayNarrow(weekday time.Weekday) string {
+ return br.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (br *br_FR) WeekdaysNarrow() []string {
+ return br.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (br *br_FR) WeekdayShort(weekday time.Weekday) string {
+ return br.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (br *br_FR) WeekdaysShort() []string {
+ return br.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (br *br_FR) WeekdayWide(weekday time.Weekday) string {
+ return br.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (br *br_FR) WeekdaysWide() []string {
+ return br.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (br *br_FR) Decimal() string {
+ return br.decimal
+}
+
+// Group returns the group of number
+func (br *br_FR) Group() string {
+ return br.group
+}
+
+// Group returns the minus sign of number
+func (br *br_FR) Minus() string {
+ return br.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'br_FR' and handles both Whole and Real numbers based on 'v'
+func (br *br_FR) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'br_FR' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (br *br_FR) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, br.percentSuffix...)
+
+ b = append(b, br.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'br_FR'
+func (br *br_FR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := br.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, br.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, br.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, br.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'br_FR'
+// in accounting notation.
+func (br *br_FR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := br.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, br.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(br.group) - 1; j >= 0; j-- {
+ b = append(b, br.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, br.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, br.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, br.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, br.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'br_FR'
+func (br *br_FR) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'br_FR'
+func (br *br_FR) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'br_FR'
+func (br *br_FR) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'br_FR'
+func (br *br_FR) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, br.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, br.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'br_FR'
+func (br *br_FR) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'br_FR'
+func (br *br_FR) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'br_FR'
+func (br *br_FR) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'br_FR'
+func (br *br_FR) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, br.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := br.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/br_FR/br_FR_test.go b/vendor/github.com/go-playground/locales/br_FR/br_FR_test.go
new file mode 100644
index 000000000..ff8057059
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/br_FR/br_FR_test.go
@@ -0,0 +1,1120 @@
+package br_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "br_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/brx/brx.go b/vendor/github.com/go-playground/locales/brx/brx.go
new file mode 100644
index 000000000..9b4a643c4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/brx/brx.go
@@ -0,0 +1,668 @@
+package brx
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type brx struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'brx' locale
+func New() locales.Translator {
+ return &brx{
+ locale: "brx",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsNarrow: []string{"", "ज", "फे", "मा", "ए", "मे", "जु", "जु", "आ", "से", "अ", "न", "दि"},
+ monthsWide: []string{"", "जानुवारी", "फेब्रुवारी", "मार्स", "एफ्रिल", "मे", "जुन", "जुलाइ", "आगस्थ", "सेबथेज्ब़र", "अखथबर", "नबेज्ब़र", "दिसेज्ब़र"},
+ daysAbbreviated: []string{"रबि", "सम", "मंगल", "बुद", "बिसथि", "सुखुर", "सुनि"},
+ daysNarrow: []string{"र", "स", "मं", "बु", "बि", "सु", "सु"},
+ daysWide: []string{"रबिबार", "समबार", "मंगलबार", "बुदबार", "बिसथिबार", "सुखुरबार", "सुनिबार"},
+ periodsAbbreviated: []string{"फुं", "बेलासे"},
+ periodsWide: []string{"फुं", "बेलासे"},
+ erasAbbreviated: []string{"ईसा.पूर्व", "सन"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"HNEG": "ग्रीनलैण्ड ईस्टर्न स्टैंडर्ड टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "MST": "माकाऊ स्टैंडर्ड टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "HENOMX": "HENOMX", "HNPMX": "HNPMX", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "MDT": "माकाऊ समर टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "UYST": "ऊरुगुए समर टाईम", "HNOG": "ग्रीनलैण्ड वेस्टर्न स्टैंडर्ड टाईम", "HNNOMX": "HNNOMX", "UYT": "ऊरुगुए स्टैंडर्ड टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "CHADT": "चैथम डेलाईट टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "HEOG": "ग्रीनलैण्ड वेस्टर्न समर टाईम", "EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "HEEG": "ग्रीनलैण्ड ईस्टर्न समर टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "TMST": "तुर्कमेनीस्तान समर टाईम", "JDT": "जपान डेलाईट टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "HEPM": "सेँ पीयॅर एवं मीकलों डेलाईट टाईम", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "JST": "जपान स्टैंडर्ड टाईम", "AKDT": "अलास्का डेलाईट टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "COST": "कोलंबिया समर टाईम", "∅∅∅": "अमाज़ोन समर टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "HNCU": "क्युबा स्टैंडर्ड टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "MESZ": "मध्य यूरोप समर टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "HECU": "क्युबा डेलाईट टाईम", "HEPMX": "HEPMX", "HNPM": "सेँ पीयॅर एवं मीकलों स्टैंडर्ड टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम", "ARST": "अर्जण्टिना समर टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "ADT": "अटलांटीक डेलाईट टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "HKST": "हाँगकॉंग समर टाईम"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (brx *brx) Locale() string {
+ return brx.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'brx'
+func (brx *brx) PluralsCardinal() []locales.PluralRule {
+ return brx.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'brx'
+func (brx *brx) PluralsOrdinal() []locales.PluralRule {
+ return brx.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'brx'
+func (brx *brx) PluralsRange() []locales.PluralRule {
+ return brx.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'brx'
+func (brx *brx) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'brx'
+func (brx *brx) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'brx'
+func (brx *brx) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (brx *brx) MonthAbbreviated(month time.Month) string {
+ return brx.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (brx *brx) MonthsAbbreviated() []string {
+ return nil
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (brx *brx) MonthNarrow(month time.Month) string {
+ return brx.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (brx *brx) MonthsNarrow() []string {
+ return brx.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (brx *brx) MonthWide(month time.Month) string {
+ return brx.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (brx *brx) MonthsWide() []string {
+ return brx.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (brx *brx) WeekdayAbbreviated(weekday time.Weekday) string {
+ return brx.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (brx *brx) WeekdaysAbbreviated() []string {
+ return brx.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (brx *brx) WeekdayNarrow(weekday time.Weekday) string {
+ return brx.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (brx *brx) WeekdaysNarrow() []string {
+ return brx.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (brx *brx) WeekdayShort(weekday time.Weekday) string {
+ return brx.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (brx *brx) WeekdaysShort() []string {
+ return brx.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (brx *brx) WeekdayWide(weekday time.Weekday) string {
+ return brx.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (brx *brx) WeekdaysWide() []string {
+ return brx.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (brx *brx) Decimal() string {
+ return brx.decimal
+}
+
+// Group returns the group of number
+func (brx *brx) Group() string {
+ return brx.group
+}
+
+// Group returns the minus sign of number
+func (brx *brx) Minus() string {
+ return brx.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'brx' and handles both Whole and Real numbers based on 'v'
+func (brx *brx) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'brx' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (brx *brx) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, brx.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'brx'
+func (brx *brx) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := brx.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, brx.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'brx'
+// in accounting notation.
+func (brx *brx) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := brx.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyNegativePrefix[j])
+ }
+
+ b = append(b, brx.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, brx.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'brx'
+func (brx *brx) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'brx'
+func (brx *brx) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'brx'
+func (brx *brx) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'brx'
+func (brx *brx) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, brx.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'brx'
+func (brx *brx) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'brx'
+func (brx *brx) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'brx'
+func (brx *brx) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'brx'
+func (brx *brx) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := brx.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/brx/brx_test.go b/vendor/github.com/go-playground/locales/brx/brx_test.go
new file mode 100644
index 000000000..f6208f269
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/brx/brx_test.go
@@ -0,0 +1,1120 @@
+package brx
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "brx"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/brx_IN/brx_IN.go b/vendor/github.com/go-playground/locales/brx_IN/brx_IN.go
new file mode 100644
index 000000000..4d9333708
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/brx_IN/brx_IN.go
@@ -0,0 +1,668 @@
+package brx_IN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type brx_IN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'brx_IN' locale
+func New() locales.Translator {
+ return &brx_IN{
+ locale: "brx_IN",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsNarrow: []string{"", "ज", "फे", "मा", "ए", "मे", "जु", "जु", "आ", "से", "अ", "न", "दि"},
+ monthsWide: []string{"", "जानुवारी", "फेब्रुवारी", "मार्स", "एफ्रिल", "मे", "जुन", "जुलाइ", "आगस्थ", "सेबथेज्ब़र", "अखथबर", "नबेज्ब़र", "दिसेज्ब़र"},
+ daysAbbreviated: []string{"रबि", "सम", "मंगल", "बुद", "बिसथि", "सुखुर", "सुनि"},
+ daysNarrow: []string{"र", "स", "मं", "बु", "बि", "सु", "सु"},
+ daysWide: []string{"रबिबार", "समबार", "मंगलबार", "बुदबार", "बिसथिबार", "सुखुरबार", "सुनिबार"},
+ periodsAbbreviated: []string{"फुं", "बेलासे"},
+ periodsWide: []string{"फुं", "बेलासे"},
+ erasAbbreviated: []string{"ईसा.पूर्व", "सन"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"MDT": "माकाऊ समर टाईम", "WIT": "ईस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "COST": "कोलंबिया समर टाईम", "PDT": "पैसीफीक डेलाईट टाईम", "SAST": "दक्षिण अफ्रीका स्टैंडर्ड टाईम", "JST": "जपान स्टैंडर्ड टाईम", "AKDT": "अलास्का डेलाईट टाईम", "VET": "वेनेज़ुएला स्टैंडर्ड टाईम", "ACST": "मध्य ओस्ट्रेलिया स्टैंडर्ड टाईम", "WARST": "पश्चीम अर्जण्टिना समर टाईम", "HAT": "न्युफाऊंडलैण्ड डेलाईट टाईम", "HAST": "हवाई आलटन स्टैंडर्ड टाईम", "AWDT": "दक्षिण ओस्ट्रेलिया डेलाईट टाईम", "ACDT": "मध्य ओस्ट्रेलिया डेलाईट टाईम", "ACWDT": "मध्य-पश्चीम ओस्ट्रेलिया डेलाईट टाईम", "LHDT": "लार्ड़ होव डेलाईट टाईम", "HEPM": "सेँ पीयॅर एवं मीकलों डेलाईट टाईम", "HADT": "हवाई आलटन डेलाईट टाईम", "ChST": "चामरो स्टैंडर्ड टाईम", "CST": "सैंट्रल अमरिका स्टैंडर्ड टाईम", "WAST": "पश्चीम अफ्रीका समर टाईम", "EST": "ईस्टर्न अमरिका स्टैंडर्ड टाईम", "HNT": "न्युफाऊंडलैण्ड स्टैंडर्ड टाईम", "AST": "अटलांटीक स्टैंडर्ड टाईम", "ACWST": "मध्य-पश्चीम ओस्ट्रेलिया स्टैंडर्ड टाईम", "HNOG": "ग्रीनलैण्ड वेस्टर्न स्टैंडर्ड टाईम", "HKT": "हाँगकॉंग स्टैंडर्ड टाईम", "IST": "भारतीय स्टैंडर्ड टाईम", "MST": "माकाऊ स्टैंडर्ड टाईम", "OESZ": "ईस्टर्न यूरोप समर टाईम", "HECU": "क्युबा डेलाईट टाईम", "AEST": "पूर्वी ओस्ट्रेलिया स्टैंडर्ड टाईम", "GFT": "फ्रान्सीसी गुयाना स्टैंडर्ड टाईम", "HKST": "हाँगकॉंग समर टाईम", "∅∅∅": "पेरु समर टाईम", "AEDT": "पूर्वी ओस्ट्रेलिया डेलाईट टाईम", "WESZ": "वेस्टर्न यूरोप समर टाईम", "MEZ": "मध्य यूरोप स्टैंडर्ड टाईम", "COT": "कोलंबिया स्टैंडर्ड टाईम", "WITA": "ईंडोनीशिया स्टैंडर्ड टाईम", "CLT": "चीली स्टैंडर्ड टाईम", "JDT": "जपान डेलाईट टाईम", "LHST": "लार्ड़ होव स्टैंडर्ड टाईम", "ARST": "अर्जण्टिना समर टाईम", "UYST": "ऊरुगुए समर टाईम", "AKST": "अलास्का स्टैंडर्ड टाईम", "EAT": "पूर्वी अफ्रीका स्टैंडर्ड टाईम", "BT": "भुटान स्टैंडर्ड टाईम", "CLST": "चीली समर टाईम", "HEPMX": "HEPMX", "SRT": "सुरीनाम स्टैंडर्ड टाईम", "EDT": "ईस्टर्न अमरिका डेलाईट टाईम", "MESZ": "मध्य यूरोप समर टाईम", "ART": "अर्जनटिना स्टैंडर्ड टाईम", "UYT": "ऊरुगुए स्टैंडर्ड टाईम", "CHAST": "चैथम स्टैंडर्ड टाईम", "AWST": "दक्षिण ओस्ट्रेलिया स्टैंडर्ड टाईम", "WART": "पश्चीम अर्जण्टिना स्टैंडर्ड टाईम", "TMT": "तुर्कमेनीस्तान स्टैंडर्ड टाईम", "PST": "पैसीफीक स्टैंडर्ड टाईम", "NZDT": "न्युज़ीलैण्ड डेलाईट टाईम", "ECT": "एक्वाडौर स्टैंडर्ड टाईम", "HNNOMX": "HNNOMX", "OEZ": "ईस्टर्न यूरोप स्टैंडर्ड टाईम", "HNCU": "क्युबा स्टैंडर्ड टाईम", "HNPMX": "HNPMX", "ADT": "अटलांटीक डेलाईट टाईम", "MYT": "मलेशिया स्टैंडर्ड टाईम", "HENOMX": "HENOMX", "TMST": "तुर्कमेनीस्तान समर टाईम", "GYT": "गुयाना स्टैंडर्ड टाईम", "CDT": "सैंट्रल अमरिका डेलाईट टाईम", "WAT": "पश्चीम अफ्रीका स्टैंडर्ड टाईम", "BOT": "बोलिविया स्टैंडर्ड टाईम", "HEEG": "ग्रीनलैण्ड ईस्टर्न समर टाईम", "HEOG": "ग्रीनलैण्ड वेस्टर्न समर टाईम", "CAT": "मध्य अफ्रीका स्टैंडर्ड टाईम", "GMT": "ग्रीनीच स्टैंडर्ड टाईम", "CHADT": "चैथम डेलाईट टाईम", "WEZ": "वेस्टर्न यूरोप स्टैंडर्ड टाईम", "WIB": "वेस्टर्न ईंडोनीशिया स्टैंडर्ड टाईम", "NZST": "न्युज़ीलैण्ड स्टैंडर्ड टाईम", "SGT": "सींगापुर स्टैंडर्ड टाईम", "HNEG": "ग्रीनलैण्ड ईस्टर्न स्टैंडर्ड टाईम", "HNPM": "सेँ पीयॅर एवं मीकलों स्टैंडर्ड टाईम"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (brx *brx_IN) Locale() string {
+ return brx.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'brx_IN'
+func (brx *brx_IN) PluralsCardinal() []locales.PluralRule {
+ return brx.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'brx_IN'
+func (brx *brx_IN) PluralsOrdinal() []locales.PluralRule {
+ return brx.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'brx_IN'
+func (brx *brx_IN) PluralsRange() []locales.PluralRule {
+ return brx.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'brx_IN'
+func (brx *brx_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'brx_IN'
+func (brx *brx_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'brx_IN'
+func (brx *brx_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (brx *brx_IN) MonthAbbreviated(month time.Month) string {
+ return brx.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (brx *brx_IN) MonthsAbbreviated() []string {
+ return nil
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (brx *brx_IN) MonthNarrow(month time.Month) string {
+ return brx.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (brx *brx_IN) MonthsNarrow() []string {
+ return brx.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (brx *brx_IN) MonthWide(month time.Month) string {
+ return brx.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (brx *brx_IN) MonthsWide() []string {
+ return brx.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (brx *brx_IN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return brx.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (brx *brx_IN) WeekdaysAbbreviated() []string {
+ return brx.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (brx *brx_IN) WeekdayNarrow(weekday time.Weekday) string {
+ return brx.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (brx *brx_IN) WeekdaysNarrow() []string {
+ return brx.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (brx *brx_IN) WeekdayShort(weekday time.Weekday) string {
+ return brx.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (brx *brx_IN) WeekdaysShort() []string {
+ return brx.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (brx *brx_IN) WeekdayWide(weekday time.Weekday) string {
+ return brx.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (brx *brx_IN) WeekdaysWide() []string {
+ return brx.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (brx *brx_IN) Decimal() string {
+ return brx.decimal
+}
+
+// Group returns the group of number
+func (brx *brx_IN) Group() string {
+ return brx.group
+}
+
+// Group returns the minus sign of number
+func (brx *brx_IN) Minus() string {
+ return brx.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'brx_IN' and handles both Whole and Real numbers based on 'v'
+func (brx *brx_IN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'brx_IN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (brx *brx_IN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, brx.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'brx_IN'
+func (brx *brx_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := brx.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, brx.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, brx.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'brx_IN'
+// in accounting notation.
+func (brx *brx_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := brx.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, brx.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, brx.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyNegativePrefix[j])
+ }
+
+ b = append(b, brx.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(brx.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, brx.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, brx.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, brx.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, brx.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'brx_IN'
+func (brx *brx_IN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, brx.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, brx.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, brx.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := brx.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/brx_IN/brx_IN_test.go b/vendor/github.com/go-playground/locales/brx_IN/brx_IN_test.go
new file mode 100644
index 000000000..a76b2e1ef
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/brx_IN/brx_IN_test.go
@@ -0,0 +1,1120 @@
+package brx_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "brx_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bs/bs.go b/vendor/github.com/go-playground/locales/bs/bs.go
new file mode 100644
index 000000000..8d109f621
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs/bs.go
@@ -0,0 +1,636 @@
+package bs
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bs struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bs' locale
+func New() locales.Translator {
+ return &bs{
+ locale: "bs",
+ pluralsCardinal: []locales.PluralRule{2, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "KM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "kn", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "din.", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec"},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januar", "februar", "mart", "april", "maj", "juni", "juli", "avgust", "septembar", "oktobar", "novembar", "decembar"},
+ daysAbbreviated: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysNarrow: []string{"N", "P", "U", "S", "Č", "P", "S"},
+ daysShort: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysWide: []string{"nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"},
+ periodsAbbreviated: []string{"prijepodne", "popodne"},
+ periodsNarrow: []string{"prijepodne", "popodne"},
+ periodsWide: []string{"prijepodne", "popodne"},
+ erasAbbreviated: []string{"p. n. e.", "n. e."},
+ erasNarrow: []string{"pr.n.e.", "AD"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"NZST": "Novozelandsko standardno vrijeme", "HKT": "Hongkonško standardno vrijeme", "HAST": "Havajsko-aleućansko standardno vrijeme", "HKST": "Hongkonško ljetno vrijeme", "HNNOMX": "Sjeverozapadno meksičko standardno vrijeme", "GMT": "Griničko vrijeme", "AWST": "Zapadnoaustralijsko standardno vrijeme", "AEST": "Istočnoaustralijsko standardno vrijeme", "BT": "Butansko vrijeme", "MYT": "Malezijsko vrijeme", "HNOG": "Zapadnogrenlandsko standardno vrijeme", "AST": "Sjevernoameričko atlantsko standardno vrijeme", "WESZ": "Zapadnoevropsko ljetno vrijeme", "MEZ": "Centralnoevropsko standardno vrijeme", "OESZ": "Istočnoevropsko ljetno vrijeme", "TMT": "Turkmenistansko standardno vrijeme", "CHADT": "Čatamsko ljetno vrijeme", "HNCU": "Kubansko standardno vrijeme", "HECU": "Kubansko ljetno vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "EAT": "Istočnoafričko vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "MST": "Sjevernoameričko planinsko standardno vrijeme", "MDT": "Sjevernoameričko planinsko ljetno vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "AKDT": "Aljaskansko ljetno vrijeme", "WARST": "Zapadnoargentinsko ljetno vrijeme", "COST": "Kolumbijsko ljetno vrijeme", "GYT": "Gvajansko vrijeme", "WAST": "Zapadnoafričko ljetno vrijeme", "NZDT": "Novozelandsko ljetno vrijeme", "WIT": "Istočnoindonezijsko vrijeme", "ART": "Argentinsko standardno vrijeme", "COT": "Kolumbijsko standardno vrijeme", "SAST": "Južnoafričko standardno vrijeme", "ACWST": "Australijsko centralnozapadno standardno vrijeme", "ACWDT": "Australijsko centralnozapadno ljetno vrijeme", "HEEG": "Istočnogrenlandsko ljetno vrijeme", "HNT": "Njufaundlendsko standardno vrijeme", "CHAST": "Čatamsko standardno vrijeme", "CDT": "Sjevernoameričko centralno ljetno vrijeme", "HNEG": "Istočnogrenlandsko standardno vrijeme", "MESZ": "Centralnoevropsko ljetno vrijeme", "CLST": "Čileansko ljetno vrijeme", "AWDT": "Zapadnoaustralijsko ljetno vrijeme", "WAT": "Zapadnoafričko standardno vrijeme", "HAT": "Njufaundlendsko ljetno vrijeme", "VET": "Venecuelansko vrijeme", "HENOMX": "Sjeverozapadno meksičko ljetno vrijeme", "HADT": "Havajsko-aleućansko ljetno vrijeme", "HEPMX": "Meksičko pacifičko ljetno vrijeme", "AEDT": "Istočnoaustralijsko ljetno vrijeme", "AKST": "Aljaskansko standardno vrijeme", "EST": "Sjevernoameričko istočno standardno vrijeme", "ACDT": "Centralnoaustralijsko ljetno vrijeme", "ARST": "Argentinsko ljetno vrijeme", "UYT": "Urugvajsko standardno vrijeme", "ChST": "Čamorsko standardno vrijeme", "CST": "Sjevernoameričko centralno standardno vrijeme", "PST": "Sjevernoameričko pacifičko standardno vrijeme", "EDT": "Sjevernoameričko istočno ljetno vrijeme", "CLT": "Čileansko standardno vrijeme", "JST": "Japansko standardno vrijeme", "IST": "Indijsko standardno vrijeme", "CAT": "Centralnoafričko vrijeme", "UYST": "Urugvajsko ljetno vrijeme", "OEZ": "Istočnoevropsko standardno vrijeme", "PDT": "Sjevernoameričko pacifičko ljetno vrijeme", "JDT": "Japansko ljetno vrijeme", "WART": "Zapadnoargentinsko standardno vrijeme", "HEPM": "Ljetno vrijeme na Ostrvima Sveti Petar i Mikelon", "SRT": "Surinamsko vrijeme", "∅∅∅": "Brazilijsko ljetno vrijeme", "ADT": "Sjevernoameričko atlantsko ljetno vrijeme", "ECT": "Ekvadorsko vrijeme", "WEZ": "Zapadnoevropsko standardno vrijeme", "BOT": "Bolivijsko vrijeme", "SGT": "Singapursko standardno vrijeme", "HEOG": "Zapadnogrenlandsko ljetno vrijeme", "TMST": "Turkmenistansko ljetno vrijeme", "HNPMX": "Meksičko pacifičko standardno vrijeme", "GFT": "Francuskogvajansko vrijeme", "ACST": "Centralnoaustralijsko standardno vrijeme", "LHDT": "Ljetno vrijeme na Ostrvu Lord Hau", "HNPM": "Standardno vrijeme na Ostrvima Sveti Petar i Mikelon"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bs *bs) Locale() string {
+ return bs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bs'
+func (bs *bs) PluralsCardinal() []locales.PluralRule {
+ return bs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bs'
+func (bs *bs) PluralsOrdinal() []locales.PluralRule {
+ return bs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bs'
+func (bs *bs) PluralsRange() []locales.PluralRule {
+ return bs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bs'
+func (bs *bs) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ fMod10 := f % 10
+ fMod100 := f % 100
+
+ if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bs'
+func (bs *bs) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bs'
+func (bs *bs) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bs.CardinalPluralRule(num1, v1)
+ end := bs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bs *bs) MonthAbbreviated(month time.Month) string {
+ return bs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bs *bs) MonthsAbbreviated() []string {
+ return bs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bs *bs) MonthNarrow(month time.Month) string {
+ return bs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bs *bs) MonthsNarrow() []string {
+ return bs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bs *bs) MonthWide(month time.Month) string {
+ return bs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bs *bs) MonthsWide() []string {
+ return bs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bs *bs) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bs *bs) WeekdaysAbbreviated() []string {
+ return bs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bs *bs) WeekdayNarrow(weekday time.Weekday) string {
+ return bs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bs *bs) WeekdaysNarrow() []string {
+ return bs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bs *bs) WeekdayShort(weekday time.Weekday) string {
+ return bs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bs *bs) WeekdaysShort() []string {
+ return bs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bs *bs) WeekdayWide(weekday time.Weekday) string {
+ return bs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bs *bs) WeekdaysWide() []string {
+ return bs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bs *bs) Decimal() string {
+ return bs.decimal
+}
+
+// Group returns the group of number
+func (bs *bs) Group() string {
+ return bs.group
+}
+
+// Group returns the minus sign of number
+func (bs *bs) Minus() string {
+ return bs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bs' and handles both Whole and Real numbers based on 'v'
+func (bs *bs) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bs' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bs *bs) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bs.percentSuffix...)
+
+ b = append(b, bs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bs'
+func (bs *bs) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bs'
+// in accounting notation.
+func (bs *bs) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bs'
+func (bs *bs) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bs'
+func (bs *bs) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bs'
+func (bs *bs) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bs'
+func (bs *bs) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bs'
+func (bs *bs) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bs'
+func (bs *bs) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bs'
+func (bs *bs) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bs'
+func (bs *bs) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bs/bs_test.go b/vendor/github.com/go-playground/locales/bs/bs_test.go
new file mode 100644
index 000000000..91c7d67cc
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs/bs_test.go
@@ -0,0 +1,1120 @@
+package bs
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl.go b/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl.go
new file mode 100644
index 000000000..20a01cee1
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl.go
@@ -0,0 +1,651 @@
+package bs_Cyrl
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bs_Cyrl struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bs_Cyrl' locale
+func New() locales.Translator {
+ return &bs_Cyrl{
+ locale: "bs_Cyrl",
+ pluralsCardinal: []locales.PluralRule{2, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "КМ", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "Кч", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "зл", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "дин.", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "Тл", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "јан", "феб", "мар", "апр", "мај", "јун", "јул", "ауг", "сеп", "окт", "нов", "дец"},
+ monthsNarrow: []string{"", "ј", "ф", "м", "а", "м", "ј", "ј", "а", "с", "о", "н", "д"},
+ monthsWide: []string{"", "јануар", "фебруар", "март", "април", "мај", "јуни", "јули", "аугуст", "септембар", "октобар", "новембар", "децембар"},
+ daysAbbreviated: []string{"нед", "пон", "уто", "сри", "чет", "пет", "суб"},
+ daysNarrow: []string{"н", "п", "у", "с", "ч", "п", "с"},
+ daysShort: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysWide: []string{"недјеља", "понедјељак", "уторак", "сриједа", "четвртак", "петак", "субота"},
+ periodsAbbreviated: []string{"пре подне", "поподне"},
+ periodsNarrow: []string{"", ""},
+ periodsWide: []string{"пре подне", "поподне"},
+ erasAbbreviated: []string{"п. н. е.", "н. е."},
+ erasNarrow: []string{"п.н.е.", "н.е."},
+ erasWide: []string{"прије нове ере", "нове ере"},
+ timezones: map[string]string{"IST": "Индијско стандардно време", "ART": "Аргентина стандардно време", "COT": "Колумбија стандардно време", "AEST": "Аустралијско источно стандардно време", "ACDT": "Аустралијско централно летње рачунање времена", "HNOG": "Западни Гренланд стандардно време", "MEZ": "Средњеевропско стандардно време", "HKT": "Хонг Конг стандардно време", "GMT": "Гринвич средње време", "OEZ": "Источноевропско стандардно време", "PDT": "Пацифичко летње рачунање времена", "JST": "Јапанско стандардно време", "NZDT": "Нови Зеланд летње рачунање времена", "ACWDT": "Аустралијско централно западно летње рачунање времена", "LHST": "Лорд Хов стандардно време", "HAT": "Њуфаундленд летње рачунање времена", "HNPMX": "Meksičko pacifičko standardno vrijeme", "SGT": "Сингапур стандардно време", "HNEG": "Источни Гренланд стандардно време", "HEOG": "Западни Гренланд летње рачунање времена", "UYT": "Уругвај стандардно време", "AWST": "Аустралијско западно стандардно време", "WITA": "Централно-индонезијско време", "CLST": "Чиле летње рачунање времена", "OESZ": "Источноевропско летње рачунање времена", "CHADT": "Чатам летње рачунање времена", "NZST": "Нови Зеланд стандардно време", "MYT": "Малезија време", "HNNOMX": "Sjeverozapadno meksičko standardno vrijeme", "GYT": "Гвајана време", "EDT": "Источно летње рачунање времена", "COST": "Колумбија летње рачунање времена", "MST": "Планинско стандардно време", "GFT": "Француска Гвајана време", "TMST": "Туркменистан летње рачунање времена", "ACST": "Аустралијско централно стандардно време", "VET": "Венецуела време", "CAT": "Централно-афричко време", "HADT": "Хавајско-алеутско летње рачунање времена", "CHAST": "Чатам стандардно време", "WIB": "Западно-индонезијско време", "AKDT": "Аљашко летње време", "ACWST": "Аустралијско централно западно стандардно време", "LHDT": "Лорд Хов летње рачунање времена", "PST": "Пацифичко стандардно време", "BOT": "Боливија време", "ECT": "Еквадор време", "HEPM": "Сен Пјер и Микелон летње рачунање вемена", "ARST": "Аргентина летње рачунање времена", "CST": "Централно стандардно време", "SRT": "Суринам време", "WIT": "Источно-индонезијско време", "HECU": "Куба летње рачунање времена", "ADT": "Атланско лтње рачунање времена", "BT": "Бутан време", "HKST": "Хонгконшко летње рачунање времена", "HNT": "Њуфаундленд стандардно време", "HNPM": "Сен Пјер и Микелон стандардно време", "WAST": "Западно-афричко летње рачунање времена", "∅∅∅": "Акре летње рачунање времена", "AEDT": "Аустралијско источно летње рачунање времена", "JDT": "Јапанско летње рачунање времена", "EST": "Источно стандардно време", "UYST": "Уругвај летње рачунање времена", "AKST": "Аљашко стандардно време", "WART": "Западна Аргентина стандардно време", "HENOMX": "Sjeverozapadno meksičko ljetno vrijeme", "EAT": "Источно-афричко време", "CLT": "Чиле стандардно време", "HAST": "Хавајско-алеутско стандардно време", "ChST": "Чаморо време", "AST": "Атланско стандардно време", "SAST": "Јужно-афричко време", "WAT": "Западно-афричко стандардно време", "HEEG": "Источни Гренланд летње рачунање времена", "WARST": "Западна Аргентина летње рачунање времена", "HNCU": "Куба стандардно време", "AWDT": "Аустралијско западно летње рачунање времена", "HEPMX": "Meksičko pacifičko ljetno vrijeme", "CDT": "Централно летње рачунање времена", "MDT": "Планинско летње рачунање времена", "WEZ": "Западноевропско стандардно време", "WESZ": "Западноевропско летње рачунање времена", "MESZ": "Средњеевропско летње рачунање времена", "TMT": "Туркменистан стандардно време"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bs *bs_Cyrl) Locale() string {
+ return bs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bs_Cyrl'
+func (bs *bs_Cyrl) PluralsCardinal() []locales.PluralRule {
+ return bs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bs_Cyrl'
+func (bs *bs_Cyrl) PluralsOrdinal() []locales.PluralRule {
+ return bs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bs_Cyrl'
+func (bs *bs_Cyrl) PluralsRange() []locales.PluralRule {
+ return bs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Cyrl'
+func (bs *bs_Cyrl) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ fMod10 := f % 10
+ fMod100 := f % 100
+
+ if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Cyrl'
+func (bs *bs_Cyrl) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bs_Cyrl'
+func (bs *bs_Cyrl) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bs.CardinalPluralRule(num1, v1)
+ end := bs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bs *bs_Cyrl) MonthAbbreviated(month time.Month) string {
+ return bs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bs *bs_Cyrl) MonthsAbbreviated() []string {
+ return bs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bs *bs_Cyrl) MonthNarrow(month time.Month) string {
+ return bs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bs *bs_Cyrl) MonthsNarrow() []string {
+ return bs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bs *bs_Cyrl) MonthWide(month time.Month) string {
+ return bs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bs *bs_Cyrl) MonthsWide() []string {
+ return bs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bs *bs_Cyrl) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bs *bs_Cyrl) WeekdaysAbbreviated() []string {
+ return bs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bs *bs_Cyrl) WeekdayNarrow(weekday time.Weekday) string {
+ return bs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bs *bs_Cyrl) WeekdaysNarrow() []string {
+ return bs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bs *bs_Cyrl) WeekdayShort(weekday time.Weekday) string {
+ return bs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bs *bs_Cyrl) WeekdaysShort() []string {
+ return bs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bs *bs_Cyrl) WeekdayWide(weekday time.Weekday) string {
+ return bs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bs *bs_Cyrl) WeekdaysWide() []string {
+ return bs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bs *bs_Cyrl) Decimal() string {
+ return bs.decimal
+}
+
+// Group returns the group of number
+func (bs *bs_Cyrl) Group() string {
+ return bs.group
+}
+
+// Group returns the minus sign of number
+func (bs *bs_Cyrl) Minus() string {
+ return bs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bs_Cyrl' and handles both Whole and Real numbers based on 'v'
+func (bs *bs_Cyrl) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bs_Cyrl' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bs *bs_Cyrl) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Cyrl'
+// in accounting notation.
+func (bs *bs_Cyrl) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bs_Cyrl'
+func (bs *bs_Cyrl) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl_test.go b/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl_test.go
new file mode 100644
index 000000000..b4132d533
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Cyrl/bs_Cyrl_test.go
@@ -0,0 +1,1120 @@
+package bs_Cyrl
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Cyrl"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA.go b/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA.go
new file mode 100644
index 000000000..35790047d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA.go
@@ -0,0 +1,636 @@
+package bs_Cyrl_BA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bs_Cyrl_BA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bs_Cyrl_BA' locale
+func New() locales.Translator {
+ return &bs_Cyrl_BA{
+ locale: "bs_Cyrl_BA",
+ pluralsCardinal: []locales.PluralRule{2, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec"},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januar", "februar", "mart", "april", "maj", "juni", "juli", "avgust", "septembar", "oktobar", "novembar", "decembar"},
+ daysAbbreviated: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysNarrow: []string{"N", "P", "U", "S", "Č", "P", "S"},
+ daysShort: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysWide: []string{"nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"},
+ periodsAbbreviated: []string{"prijepodne", "popodne"},
+ periodsNarrow: []string{"prijepodne", "popodne"},
+ periodsWide: []string{"prijepodne", "popodne"},
+ erasAbbreviated: []string{"p. n. e.", "n. e."},
+ erasNarrow: []string{"pr.n.e.", "AD"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"WITA": "Centralnoindonezijsko vrijeme", "ARST": "Argentinsko ljetno vrijeme", "CDT": "Sjevernoameričko centralno ljetno vrijeme", "AEST": "Istočnoaustralijsko standardno vrijeme", "WESZ": "Zapadnoevropsko ljetno vrijeme", "BT": "Butansko vrijeme", "MYT": "Malezijsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno vrijeme", "WARST": "Zapadnoargentinsko ljetno vrijeme", "∅∅∅": "Amazonsko ljetno vrijeme", "ChST": "Čamorsko standardno vrijeme", "CHAST": "Čatamsko standardno vrijeme", "HEPMX": "Meksičko pacifičko ljetno vrijeme", "AST": "Sjevernoameričko atlantsko standardno vrijeme", "HNEG": "Istočnogrenlandsko standardno vrijeme", "HENOMX": "Sjeverozapadno meksičko ljetno vrijeme", "JST": "Japansko standardno vrijeme", "AKDT": "Aljaskansko ljetno vrijeme", "EST": "Sjevernoameričko istočno standardno vrijeme", "CAT": "Centralnoafričko vrijeme", "EDT": "Sjevernoameričko istočno ljetno vrijeme", "MESZ": "Centralnoevropsko ljetno vrijeme", "OEZ": "Istočnoevropsko standardno vrijeme", "CST": "Sjevernoameričko centralno standardno vrijeme", "PST": "Sjevernoameričko pacifičko standardno vrijeme", "WEZ": "Zapadnoevropsko standardno vrijeme", "AKST": "Aljaskansko standardno vrijeme", "HEEG": "Istočnogrenlandsko ljetno vrijeme", "HNPM": "Standardno vrijeme na Ostrvima Sveti Petar i Mikelon", "SAST": "Južnoafričko standardno vrijeme", "BOT": "Bolivijsko vrijeme", "JDT": "Japansko ljetno vrijeme", "LHDT": "Ljetno vrijeme na Ostrvu Lord Hau", "GMT": "Griničko vrijeme", "WAT": "Zapadnoafričko standardno vrijeme", "MEZ": "Centralnoevropsko standardno vrijeme", "IST": "Indijsko standardno vrijeme", "HNNOMX": "Sjeverozapadno meksičko standardno vrijeme", "EAT": "Istočnoafričko vrijeme", "HNCU": "Kubansko standardno vrijeme", "MDT": "Sjevernoameričko planinsko ljetno vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "SGT": "Singapursko standardno vrijeme", "HNT": "Njufaundlendsko standardno vrijeme", "AWDT": "Zapadnoaustralijsko ljetno vrijeme", "AEDT": "Istočnoaustralijsko ljetno vrijeme", "HKT": "Hongkonško standardno vrijeme", "ACWST": "Australijsko centralnozapadno standardno vrijeme", "SRT": "Surinamsko vrijeme", "HADT": "Havajsko-aleućansko ljetno vrijeme", "UYT": "Urugvajsko standardno vrijeme", "UYST": "Urugvajsko ljetno vrijeme", "CHADT": "Čatamsko ljetno vrijeme", "MST": "Sjevernoameričko planinsko standardno vrijeme", "HNOG": "Zapadnogrenlandsko standardno vrijeme", "CLST": "Čileansko ljetno vrijeme", "COT": "Kolumbijsko standardno vrijeme", "HEOG": "Zapadnogrenlandsko ljetno vrijeme", "ACWDT": "Australijsko centralnozapadno ljetno vrijeme", "VET": "Venecuelansko vrijeme", "TMT": "Turkmenistansko standardno vrijeme", "GYT": "Gvajansko vrijeme", "HNPMX": "Meksičko pacifičko standardno vrijeme", "ADT": "Sjevernoameričko atlantsko ljetno vrijeme", "ECT": "Ekvadorsko vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "CLT": "Čileansko standardno vrijeme", "WIT": "Istočnoindonezijsko vrijeme", "HAST": "Havajsko-aleućansko standardno vrijeme", "PDT": "Sjevernoameričko pacifičko ljetno vrijeme", "AWST": "Zapadnoaustralijsko standardno vrijeme", "WAST": "Zapadnoafričko ljetno vrijeme", "NZST": "Novozelandsko standardno vrijeme", "HKST": "Hongkonško ljetno vrijeme", "NZDT": "Novozelandsko ljetno vrijeme", "ACST": "Centralnoaustralijsko standardno vrijeme", "HAT": "Njufaundlendsko ljetno vrijeme", "OESZ": "Istočnoevropsko ljetno vrijeme", "ART": "Argentinsko standardno vrijeme", "GFT": "Francuskogvajansko vrijeme", "WART": "Zapadnoargentinsko standardno vrijeme", "TMST": "Turkmenistansko ljetno vrijeme", "COST": "Kolumbijsko ljetno vrijeme", "HECU": "Kubansko ljetno vrijeme", "HEPM": "Ljetno vrijeme na Ostrvima Sveti Petar i Mikelon"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bs *bs_Cyrl_BA) Locale() string {
+ return bs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) PluralsCardinal() []locales.PluralRule {
+ return bs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) PluralsOrdinal() []locales.PluralRule {
+ return bs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) PluralsRange() []locales.PluralRule {
+ return bs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ fMod10 := f % 10
+ fMod100 := f % 100
+
+ if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bs.CardinalPluralRule(num1, v1)
+ end := bs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bs *bs_Cyrl_BA) MonthAbbreviated(month time.Month) string {
+ return bs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bs *bs_Cyrl_BA) MonthsAbbreviated() []string {
+ return bs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bs *bs_Cyrl_BA) MonthNarrow(month time.Month) string {
+ return bs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bs *bs_Cyrl_BA) MonthsNarrow() []string {
+ return bs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bs *bs_Cyrl_BA) MonthWide(month time.Month) string {
+ return bs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bs *bs_Cyrl_BA) MonthsWide() []string {
+ return bs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bs *bs_Cyrl_BA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bs *bs_Cyrl_BA) WeekdaysAbbreviated() []string {
+ return bs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bs *bs_Cyrl_BA) WeekdayNarrow(weekday time.Weekday) string {
+ return bs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bs *bs_Cyrl_BA) WeekdaysNarrow() []string {
+ return bs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bs *bs_Cyrl_BA) WeekdayShort(weekday time.Weekday) string {
+ return bs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bs *bs_Cyrl_BA) WeekdaysShort() []string {
+ return bs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bs *bs_Cyrl_BA) WeekdayWide(weekday time.Weekday) string {
+ return bs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bs *bs_Cyrl_BA) WeekdaysWide() []string {
+ return bs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bs *bs_Cyrl_BA) Decimal() string {
+ return bs.decimal
+}
+
+// Group returns the group of number
+func (bs *bs_Cyrl_BA) Group() string {
+ return bs.group
+}
+
+// Group returns the minus sign of number
+func (bs *bs_Cyrl_BA) Minus() string {
+ return bs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bs_Cyrl_BA' and handles both Whole and Real numbers based on 'v'
+func (bs *bs_Cyrl_BA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bs_Cyrl_BA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bs *bs_Cyrl_BA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bs.percentSuffix...)
+
+ b = append(b, bs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Cyrl_BA'
+// in accounting notation.
+func (bs *bs_Cyrl_BA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bs_Cyrl_BA'
+func (bs *bs_Cyrl_BA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA_test.go b/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA_test.go
new file mode 100644
index 000000000..42efd373e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Cyrl_BA/bs_Cyrl_BA_test.go
@@ -0,0 +1,1120 @@
+package bs_Cyrl_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Cyrl_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn.go b/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn.go
new file mode 100644
index 000000000..66c89709c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn.go
@@ -0,0 +1,636 @@
+package bs_Latn
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bs_Latn struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bs_Latn' locale
+func New() locales.Translator {
+ return &bs_Latn{
+ locale: "bs_Latn",
+ pluralsCardinal: []locales.PluralRule{2, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec"},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januar", "februar", "mart", "april", "maj", "juni", "juli", "avgust", "septembar", "oktobar", "novembar", "decembar"},
+ daysAbbreviated: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysNarrow: []string{"N", "P", "U", "S", "Č", "P", "S"},
+ daysShort: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysWide: []string{"nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"},
+ periodsAbbreviated: []string{"prijepodne", "popodne"},
+ periodsNarrow: []string{"prijepodne", "popodne"},
+ periodsWide: []string{"prijepodne", "popodne"},
+ erasAbbreviated: []string{"p. n. e.", "n. e."},
+ erasNarrow: []string{"pr.n.e.", "AD"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"LHDT": "Ljetno vrijeme na Ostrvu Lord Hau", "MDT": "Makao letnje računanje vremena", "HADT": "Havajsko-aleućansko ljetno vrijeme", "WEZ": "Zapadnoevropsko standardno vrijeme", "BOT": "Bolivijsko vrijeme", "GFT": "Francuskogvajansko vrijeme", "EST": "Sjevernoameričko istočno standardno vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "UYST": "Urugvajsko ljetno vrijeme", "EAT": "Istočnoafričko vrijeme", "JDT": "Japansko ljetno vrijeme", "ACST": "Centralnoaustralijsko standardno vrijeme", "ACWDT": "Australijsko centralnozapadno ljetno vrijeme", "WIT": "Istočnoindonezijsko vrijeme", "CAT": "Centralnoafričko vrijeme", "HENOMX": "Sjeverozapadno meksičko ljetno vrijeme", "MST": "Makao standardno vreme", "COST": "Kolumbijsko ljetno vrijeme", "HAST": "Havajsko-aleućansko standardno vrijeme", "PDT": "Sjevernoameričko pacifičko ljetno vrijeme", "WESZ": "Zapadnoevropsko ljetno vrijeme", "HNT": "Njufaundlendsko standardno vrijeme", "VET": "Venecuelansko vrijeme", "MESZ": "Centralnoevropsko ljetno vrijeme", "IST": "Indijsko standardno vrijeme", "HKST": "Hongkonško ljetno vrijeme", "CHAST": "Čatamsko standardno vrijeme", "CHADT": "Čatamsko ljetno vrijeme", "ACWST": "Australijsko centralnozapadno standardno vrijeme", "HNPM": "Standardno vrijeme na Ostrvima Sveti Petar i Mikelon", "HEPM": "Ljetno vrijeme na Ostrvima Sveti Petar i Mikelon", "CST": "Sjevernoameričko centralno standardno vrijeme", "AWST": "Zapadnoaustralijsko standardno vrijeme", "AEDT": "Istočnoaustralijsko ljetno vrijeme", "NZST": "Novozelandsko standardno vrijeme", "HEOG": "Zapadnogrenlandsko ljetno vrijeme", "TMT": "Turkmenistansko standardno vrijeme", "CLST": "Čileansko ljetno vrijeme", "EDT": "Sjevernoameričko istočno ljetno vrijeme", "AKST": "Aljaskansko standardno vrijeme", "HEEG": "Istočnogrenlandsko ljetno vrijeme", "AEST": "Istočnoaustralijsko standardno vrijeme", "WAT": "Zapadnoafričko standardno vrijeme", "MEZ": "Centralnoevropsko standardno vrijeme", "HAT": "Njufaundlendsko ljetno vrijeme", "UYT": "Urugvajsko standardno vrijeme", "GYT": "Gvajansko vrijeme", "PST": "Sjevernoameričko pacifičko standardno vrijeme", "WART": "Zapadnoargentinsko standardno vrijeme", "ARST": "Argentinsko ljetno vrijeme", "GMT": "Griničko vrijeme", "COT": "Kolumbijsko standardno vrijeme", "ADT": "Sjevernoameričko atlantsko ljetno vrijeme", "WAST": "Zapadnoafričko ljetno vrijeme", "ECT": "Ekvadorsko vrijeme", "HNNOMX": "Sjeverozapadno meksičko standardno vrijeme", "CLT": "Čileansko standardno vrijeme", "SAST": "Južnoafričko standardno vrijeme", "NZDT": "Novozelandsko ljetno vrijeme", "HNOG": "Zapadnogrenlandsko standardno vrijeme", "∅∅∅": "Amazonsko ljetno vrijeme", "CDT": "Sjevernoameričko centralno ljetno vrijeme", "HEPMX": "Meksičko pacifičko ljetno vrijeme", "AST": "Sjevernoameričko atlantsko standardno vrijeme", "OESZ": "Istočnoevropsko ljetno vrijeme", "HECU": "Kubansko ljetno vrijeme", "ART": "Argentinsko standardno vrijeme", "HNCU": "Kubansko standardno vrijeme", "HNPMX": "Meksičko pacifičko standardno vrijeme", "HNEG": "Istočnogrenlandsko standardno vrijeme", "SRT": "Surinamsko vrijeme", "OEZ": "Istočnoevropsko standardno vrijeme", "AKDT": "Aljaskansko ljetno vrijeme", "HKT": "Hongkonško standardno vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "WARST": "Zapadnoargentinsko ljetno vrijeme", "BT": "Butansko vrijeme", "MYT": "Malezijsko vrijeme", "AWDT": "Zapadnoaustralijsko ljetno vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "JST": "Japansko standardno vrijeme", "SGT": "Singapursko standardno vrijeme", "ACDT": "Centralnoaustralijsko ljetno vrijeme", "TMST": "Turkmenistansko ljetno vrijeme", "ChST": "Čamorsko standardno vrijeme"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bs *bs_Latn) Locale() string {
+ return bs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bs_Latn'
+func (bs *bs_Latn) PluralsCardinal() []locales.PluralRule {
+ return bs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bs_Latn'
+func (bs *bs_Latn) PluralsOrdinal() []locales.PluralRule {
+ return bs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bs_Latn'
+func (bs *bs_Latn) PluralsRange() []locales.PluralRule {
+ return bs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Latn'
+func (bs *bs_Latn) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod10 := i % 10
+ iMod100 := i % 100
+ fMod10 := f % 10
+ fMod100 := f % 100
+
+ if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Latn'
+func (bs *bs_Latn) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bs_Latn'
+func (bs *bs_Latn) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bs.CardinalPluralRule(num1, v1)
+ end := bs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bs *bs_Latn) MonthAbbreviated(month time.Month) string {
+ return bs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bs *bs_Latn) MonthsAbbreviated() []string {
+ return bs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bs *bs_Latn) MonthNarrow(month time.Month) string {
+ return bs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bs *bs_Latn) MonthsNarrow() []string {
+ return bs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bs *bs_Latn) MonthWide(month time.Month) string {
+ return bs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bs *bs_Latn) MonthsWide() []string {
+ return bs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bs *bs_Latn) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bs *bs_Latn) WeekdaysAbbreviated() []string {
+ return bs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bs *bs_Latn) WeekdayNarrow(weekday time.Weekday) string {
+ return bs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bs *bs_Latn) WeekdaysNarrow() []string {
+ return bs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bs *bs_Latn) WeekdayShort(weekday time.Weekday) string {
+ return bs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bs *bs_Latn) WeekdaysShort() []string {
+ return bs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bs *bs_Latn) WeekdayWide(weekday time.Weekday) string {
+ return bs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bs *bs_Latn) WeekdaysWide() []string {
+ return bs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bs *bs_Latn) Decimal() string {
+ return bs.decimal
+}
+
+// Group returns the group of number
+func (bs *bs_Latn) Group() string {
+ return bs.group
+}
+
+// Group returns the minus sign of number
+func (bs *bs_Latn) Minus() string {
+ return bs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bs_Latn' and handles both Whole and Real numbers based on 'v'
+func (bs *bs_Latn) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bs_Latn' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bs *bs_Latn) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bs.percentSuffix...)
+
+ b = append(b, bs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Latn'
+func (bs *bs_Latn) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Latn'
+// in accounting notation.
+func (bs *bs_Latn) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bs_Latn'
+func (bs *bs_Latn) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn_test.go b/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn_test.go
new file mode 100644
index 000000000..fde1ce88d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Latn/bs_Latn_test.go
@@ -0,0 +1,1120 @@
+package bs_Latn
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Latn"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA.go b/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA.go
new file mode 100644
index 000000000..7ba5f2736
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA.go
@@ -0,0 +1,636 @@
+package bs_Latn_BA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type bs_Latn_BA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'bs_Latn_BA' locale
+func New() locales.Translator {
+ return &bs_Latn_BA{
+ locale: "bs_Latn_BA",
+ pluralsCardinal: []locales.PluralRule{2, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan", "feb", "mar", "apr", "maj", "jun", "jul", "avg", "sep", "okt", "nov", "dec"},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januar", "februar", "mart", "april", "maj", "juni", "juli", "avgust", "septembar", "oktobar", "novembar", "decembar"},
+ daysAbbreviated: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysNarrow: []string{"N", "P", "U", "S", "Č", "P", "S"},
+ daysShort: []string{"ned", "pon", "uto", "sri", "čet", "pet", "sub"},
+ daysWide: []string{"nedjelja", "ponedjeljak", "utorak", "srijeda", "četvrtak", "petak", "subota"},
+ periodsAbbreviated: []string{"prijepodne", "popodne"},
+ periodsNarrow: []string{"prijepodne", "popodne"},
+ periodsWide: []string{"prijepodne", "popodne"},
+ erasAbbreviated: []string{"p. n. e.", "n. e."},
+ erasNarrow: []string{"pr.n.e.", "AD"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"BOT": "Bolivijsko vrijeme", "NZST": "Novozelandsko standardno vrijeme", "OESZ": "Istočnoevropsko ljetno vrijeme", "SAST": "Južnoafričko standardno vrijeme", "ACWST": "Australijsko centralnozapadno standardno vrijeme", "COST": "Kolumbijsko ljetno vrijeme", "HEPMX": "Meksičko pacifičko ljetno vrijeme", "CDT": "Sjevernoameričko centralno ljetno vrijeme", "WAT": "Zapadnoafričko standardno vrijeme", "MESZ": "Centralnoevropsko ljetno vrijeme", "WARST": "Zapadnoargentinsko ljetno vrijeme", "HNPMX": "Meksičko pacifičko standardno vrijeme", "CLT": "Čileansko standardno vrijeme", "CLST": "Čileansko ljetno vrijeme", "UYST": "Urugvajsko ljetno vrijeme", "ChST": "Čamorsko standardno vrijeme", "HNCU": "Kubansko standardno vrijeme", "ACST": "Centralnoaustralijsko standardno vrijeme", "MEZ": "Centralnoevropsko standardno vrijeme", "TMT": "Turkmenistansko standardno vrijeme", "WEZ": "Zapadnoevropsko standardno vrijeme", "JDT": "Japansko ljetno vrijeme", "HKT": "Hongkonško standardno vrijeme", "WAST": "Zapadnoafričko ljetno vrijeme", "ART": "Argentinsko standardno vrijeme", "ARST": "Argentinsko ljetno vrijeme", "BT": "Butansko vrijeme", "ACWDT": "Australijsko centralnozapadno ljetno vrijeme", "IST": "Indijsko standardno vrijeme", "LHST": "Standardno vrijeme na Ostrvu Lord Hau", "CAT": "Centralnoafričko vrijeme", "MST": "Makao standardno vreme", "MDT": "Makao letnje računanje vremena", "CST": "Sjevernoameričko centralno standardno vrijeme", "PST": "Sjevernoameričko pacifičko standardno vrijeme", "AST": "Sjevernoameričko atlantsko standardno vrijeme", "GFT": "Francuskogvajansko vrijeme", "MYT": "Malezijsko vrijeme", "HENOMX": "Sjeverozapadno meksičko ljetno vrijeme", "LHDT": "Ljetno vrijeme na Ostrvu Lord Hau", "EST": "Sjevernoameričko istočno standardno vrijeme", "COT": "Kolumbijsko standardno vrijeme", "OEZ": "Istočnoevropsko standardno vrijeme", "HECU": "Kubansko ljetno vrijeme", "AKST": "Aljaskansko standardno vrijeme", "EDT": "Sjevernoameričko istočno ljetno vrijeme", "SRT": "Surinamsko vrijeme", "HAT": "Njufaundlendsko ljetno vrijeme", "WIT": "Istočnoindonezijsko vrijeme", "GMT": "Griničko vrijeme", "SGT": "Singapursko standardno vrijeme", "HNEG": "Istočnogrenlandsko standardno vrijeme", "HEOG": "Zapadnogrenlandsko ljetno vrijeme", "WITA": "Centralnoindonezijsko vrijeme", "HAST": "Havajsko-aleućansko standardno vrijeme", "HADT": "Havajsko-aleućansko ljetno vrijeme", "PDT": "Sjevernoameričko pacifičko ljetno vrijeme", "ECT": "Ekvadorsko vrijeme", "ACDT": "Centralnoaustralijsko ljetno vrijeme", "HNNOMX": "Sjeverozapadno meksičko standardno vrijeme", "ADT": "Sjevernoameričko atlantsko ljetno vrijeme", "WESZ": "Zapadnoevropsko ljetno vrijeme", "∅∅∅": "Amazonsko ljetno vrijeme", "EAT": "Istočnoafričko vrijeme", "GYT": "Gvajansko vrijeme", "CHADT": "Čatamsko ljetno vrijeme", "WIB": "Zapadnoindonezijsko vrijeme", "AKDT": "Aljaskansko ljetno vrijeme", "HNOG": "Zapadnogrenlandsko standardno vrijeme", "HKST": "Hongkonško ljetno vrijeme", "TMST": "Turkmenistansko ljetno vrijeme", "CHAST": "Čatamsko standardno vrijeme", "JST": "Japansko standardno vrijeme", "WART": "Zapadnoargentinsko standardno vrijeme", "VET": "Venecuelansko vrijeme", "HEEG": "Istočnogrenlandsko ljetno vrijeme", "AWST": "Zapadnoaustralijsko standardno vrijeme", "HNPM": "Standardno vrijeme na Ostrvima Sveti Petar i Mikelon", "HEPM": "Ljetno vrijeme na Ostrvima Sveti Petar i Mikelon", "UYT": "Urugvajsko standardno vrijeme", "AWDT": "Zapadnoaustralijsko ljetno vrijeme", "AEST": "Istočnoaustralijsko standardno vrijeme", "AEDT": "Istočnoaustralijsko ljetno vrijeme", "NZDT": "Novozelandsko ljetno vrijeme", "HNT": "Njufaundlendsko standardno vrijeme"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (bs *bs_Latn_BA) Locale() string {
+ return bs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'bs_Latn_BA'
+func (bs *bs_Latn_BA) PluralsCardinal() []locales.PluralRule {
+ return bs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'bs_Latn_BA'
+func (bs *bs_Latn_BA) PluralsOrdinal() []locales.PluralRule {
+ return bs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'bs_Latn_BA'
+func (bs *bs_Latn_BA) PluralsRange() []locales.PluralRule {
+ return bs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod100 := i % 100
+ iMod10 := i % 10
+ fMod100 := f % 100
+ fMod10 := f % 10
+
+ if (v == 0 && iMod10 == 1 && iMod100 != 11) || (fMod10 == 1 && fMod100 != 11) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14)) || (fMod10 >= 2 && fMod10 <= 4 && (fMod100 < 12 || fMod100 > 14)) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := bs.CardinalPluralRule(num1, v1)
+ end := bs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (bs *bs_Latn_BA) MonthAbbreviated(month time.Month) string {
+ return bs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (bs *bs_Latn_BA) MonthsAbbreviated() []string {
+ return bs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (bs *bs_Latn_BA) MonthNarrow(month time.Month) string {
+ return bs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (bs *bs_Latn_BA) MonthsNarrow() []string {
+ return bs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (bs *bs_Latn_BA) MonthWide(month time.Month) string {
+ return bs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (bs *bs_Latn_BA) MonthsWide() []string {
+ return bs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (bs *bs_Latn_BA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return bs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (bs *bs_Latn_BA) WeekdaysAbbreviated() []string {
+ return bs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (bs *bs_Latn_BA) WeekdayNarrow(weekday time.Weekday) string {
+ return bs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (bs *bs_Latn_BA) WeekdaysNarrow() []string {
+ return bs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (bs *bs_Latn_BA) WeekdayShort(weekday time.Weekday) string {
+ return bs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (bs *bs_Latn_BA) WeekdaysShort() []string {
+ return bs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (bs *bs_Latn_BA) WeekdayWide(weekday time.Weekday) string {
+ return bs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (bs *bs_Latn_BA) WeekdaysWide() []string {
+ return bs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (bs *bs_Latn_BA) Decimal() string {
+ return bs.decimal
+}
+
+// Group returns the group of number
+func (bs *bs_Latn_BA) Group() string {
+ return bs.group
+}
+
+// Group returns the minus sign of number
+func (bs *bs_Latn_BA) Minus() string {
+ return bs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'bs_Latn_BA' and handles both Whole and Real numbers based on 'v'
+func (bs *bs_Latn_BA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'bs_Latn_BA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (bs *bs_Latn_BA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, bs.percentSuffix...)
+
+ b = append(b, bs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, bs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, bs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'bs_Latn_BA'
+// in accounting notation.
+func (bs *bs_Latn_BA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := bs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, bs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, bs.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, bs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, bs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, bs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, bs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, bs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, bs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'bs_Latn_BA'
+func (bs *bs_Latn_BA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, bs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := bs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA_test.go b/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA_test.go
new file mode 100644
index 000000000..ee4346d8b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/bs_Latn_BA/bs_Latn_BA_test.go
@@ -0,0 +1,1120 @@
+package bs_Latn_BA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "bs_Latn_BA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca/ca.go b/vendor/github.com/go-playground/locales/ca/ca.go
new file mode 100644
index 000000000..db96a30fc
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca/ca.go
@@ -0,0 +1,593 @@
+package ca
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca' locale
+func New() locales.Translator {
+ return &ca{
+ locale: "ca",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "₧", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"LHST": "Hora estàndard de Lord Howe", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "HECU": "Hora d’estiu de Cuba", "HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "HKST": "Hora d’estiu de Hong Kong", "LHDT": "Horari d’estiu de Lord Howe", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "ADT": "Hora d’estiu de l’Atlàntic", "GMT": "Hora del Meridià de Greenwich", "CHAST": "Hora estàndard de Chatham", "HNT": "Hora estàndard de Terranova", "CAT": "Hora de l’Àfrica Central", "EAT": "Hora de l’Àfrica Oriental", "COST": "Hora d’estiu de Colòmbia", "CHADT": "Hora d’estiu de Chatham", "PST": "Hora estàndard del Pacífic", "MEZ": "Hora estàndard del Centre d’Europa", "WARST": "Hora d’estiu de l’oest de l’Argentina", "AWST": "Hora estàndard d’Austràlia Occidental", "AWDT": "Hora d’estiu d’Austràlia Occidental", "OESZ": "Hora d’estiu de l’Est d’Europa", "PDT": "Hora d’estiu del Pacífic", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "MST": "Hora estàndard de Macau", "MDT": "Hora d’estiu de Macau", "HAST": "Hora estàndard de Hawaii-Aleutianes", "ART": "Hora estàndard de l’Argentina", "GYT": "Hora de Guyana", "MESZ": "Hora d’estiu del Centre d’Europa", "VET": "Hora de Veneçuela", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "WAST": "Hora d’estiu de l’Àfrica Occidental", "JST": "Hora estàndard del Japó", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "WIB": "Hora de l’oest d’Indonèsia", "SAST": "Hora estàndard del sud de l’Àfrica", "NZST": "Hora estàndard de Nova Zelanda", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "WART": "Hora estàndard de l’oest de l’Argentina", "CLST": "Hora d’estiu de Xile", "WEZ": "Hora estàndard de l’Oest d’Europa", "AKST": "Hora estàndard d’Alaska", "EST": "Hora estàndard oriental d’Amèrica del Nord", "ACST": "Hora estàndard d’Austràlia Central", "WIT": "Hora de l’est d’Indonèsia", "TMST": "Hora d’estiu del Turkmenistan", "ECT": "Hora de l’Equador", "HKT": "Hora estàndard de Hong Kong", "TMT": "Hora estàndard del Turkmenistan", "OEZ": "Hora estàndard de l’Est d’Europa", "CDT": "Hora d’estiu central d’Amèrica del Nord", "WAT": "Hora estàndard de l’Àfrica Occidental", "BOT": "Hora de Bolívia", "JDT": "Hora d’estiu del Japó", "NZDT": "Hora d’estiu de Nova Zelanda", "∅∅∅": "Hora d’estiu de les Açores", "CLT": "Hora estàndard de Xile", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "ARST": "Hora d’estiu de l’Argentina", "HNCU": "Hora estàndard de Cuba", "MYT": "Hora de Malàisia", "AKDT": "Hora d’estiu d’Alaska", "WITA": "Hora central d’Indonèsia", "HAT": "Hora d’estiu de Terranova", "WESZ": "Hora d’estiu de l’Oest d’Europa", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "ACDT": "Hora d’estiu d’Austràlia Central", "IST": "Hora estàndard de l’Índia", "AEDT": "Hora d’estiu d’Austràlia Oriental", "CST": "Hora estàndard central d’Amèrica del Nord", "BT": "Hora de Bhutan", "SGT": "Hora de Singapur", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "SRT": "Hora de Surinam", "UYST": "Hora d’estiu de l’Uruguai", "AST": "Hora estàndard de l’Atlàntic", "GFT": "Hora de la Guaiana Francesa", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "UYT": "Hora estàndard de l’Uruguai", "ChST": "Hora de Chamorro", "AEST": "Hora estàndard d’Austràlia Oriental", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "COT": "Hora estàndard de Colòmbia"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca'
+func (ca *ca) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca'
+func (ca *ca) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca'
+func (ca *ca) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca'
+func (ca *ca) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca'
+func (ca *ca) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca'
+func (ca *ca) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca' and handles both Whole and Real numbers based on 'v'
+func (ca *ca) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca'
+func (ca *ca) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca'
+// in accounting notation.
+func (ca *ca) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca'
+func (ca *ca) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca'
+func (ca *ca) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca'
+func (ca *ca) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca'
+func (ca *ca) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca'
+func (ca *ca) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca'
+func (ca *ca) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca'
+func (ca *ca) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca'
+func (ca *ca) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca/ca_test.go b/vendor/github.com/go-playground/locales/ca/ca_test.go
new file mode 100644
index 000000000..b465e400f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca/ca_test.go
@@ -0,0 +1,1120 @@
+package ca
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca_AD/ca_AD.go b/vendor/github.com/go-playground/locales/ca_AD/ca_AD.go
new file mode 100644
index 000000000..6b59f8c6e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_AD/ca_AD.go
@@ -0,0 +1,593 @@
+package ca_AD
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca_AD struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca_AD' locale
+func New() locales.Translator {
+ return &ca_AD{
+ locale: "ca_AD",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"WEZ": "Hora estàndard de l’Oest d’Europa", "SRT": "Hora de Surinam", "CLT": "Hora estàndard de Xile", "ARST": "Hora d’estiu de l’Argentina", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "AST": "Hora estàndard de l’Atlàntic", "MYT": "Hora de Malàisia", "JDT": "Hora d’estiu del Japó", "SGT": "Hora de Singapur", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "CHAST": "Hora estàndard de Chatham", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "MEZ": "Hora estàndard del Centre d’Europa", "IST": "Hora estàndard de l’Índia", "HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "UYT": "Hora estàndard de l’Uruguai", "AWDT": "Hora d’estiu d’Austràlia Occidental", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "HAT": "Hora d’estiu de Terranova", "WITA": "Hora central d’Indonèsia", "COT": "Hora estàndard de Colòmbia", "PST": "Hora estàndard del Pacífic", "NZDT": "Hora d’estiu de Nova Zelanda", "SAST": "Hora estàndard del sud de l’Àfrica", "NZST": "Hora estàndard de Nova Zelanda", "ECT": "Hora de l’Equador", "HNT": "Hora estàndard de Terranova", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "EAT": "Hora de l’Àfrica Oriental", "UYST": "Hora d’estiu de l’Uruguai", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "BOT": "Hora de Bolívia", "AKST": "Hora estàndard d’Alaska", "MESZ": "Hora d’estiu del Centre d’Europa", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "CAT": "Hora de l’Àfrica Central", "CLST": "Hora d’estiu de Xile", "COST": "Hora d’estiu de Colòmbia", "ChST": "Hora de Chamorro", "CDT": "Hora d’estiu central d’Amèrica del Nord", "BT": "Hora de Bhutan", "GFT": "Hora de la Guaiana Francesa", "ACDT": "Hora d’estiu d’Austràlia Central", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "CST": "Hora estàndard central d’Amèrica del Nord", "WESZ": "Hora d’estiu de l’Oest d’Europa", "TMT": "Hora estàndard del Turkmenistan", "TMST": "Hora d’estiu del Turkmenistan", "ADT": "Hora d’estiu de l’Atlàntic", "LHST": "Hora estàndard de Lord Howe", "WARST": "Hora d’estiu de l’oest de l’Argentina", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "HNCU": "Hora estàndard de Cuba", "∅∅∅": "Hora d’estiu de Brasília", "WAT": "Hora estàndard de l’Àfrica Occidental", "JST": "Hora estàndard del Japó", "WART": "Hora estàndard de l’oest de l’Argentina", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "ART": "Hora estàndard de l’Argentina", "AWST": "Hora estàndard d’Austràlia Occidental", "AEDT": "Hora d’estiu d’Austràlia Oriental", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "ACST": "Hora estàndard d’Austràlia Central", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "HKST": "Hora d’estiu de Hong Kong", "VET": "Hora de Veneçuela", "GMT": "Hora del Meridià de Greenwich", "PDT": "Hora d’estiu del Pacífic", "AEST": "Hora estàndard d’Austràlia Oriental", "WAST": "Hora d’estiu de l’Àfrica Occidental", "AKDT": "Hora d’estiu d’Alaska", "LHDT": "Horari d’estiu de Lord Howe", "CHADT": "Hora d’estiu de Chatham", "HECU": "Hora d’estiu de Cuba", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "WIT": "Hora de l’est d’Indonèsia", "HAST": "Hora estàndard de Hawaii-Aleutianes", "WIB": "Hora de l’oest d’Indonèsia", "EST": "Hora estàndard oriental d’Amèrica del Nord", "HKT": "Hora estàndard de Hong Kong", "OEZ": "Hora estàndard de l’Est d’Europa", "GYT": "Hora de Guyana", "OESZ": "Hora d’estiu de l’Est d’Europa"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca_AD) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca_AD'
+func (ca *ca_AD) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca_AD'
+func (ca *ca_AD) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca_AD'
+func (ca *ca_AD) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca_AD'
+func (ca *ca_AD) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca_AD'
+func (ca *ca_AD) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca_AD'
+func (ca *ca_AD) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca_AD) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca_AD) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca_AD) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca_AD) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca_AD) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca_AD) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca_AD) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca_AD) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca_AD) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca_AD) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca_AD) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca_AD) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca_AD) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca_AD) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca_AD) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca_AD) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca_AD) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca_AD' and handles both Whole and Real numbers based on 'v'
+func (ca *ca_AD) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca_AD' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca_AD) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca_AD'
+func (ca *ca_AD) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca_AD'
+// in accounting notation.
+func (ca *ca_AD) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca_AD'
+func (ca *ca_AD) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca_AD/ca_AD_test.go b/vendor/github.com/go-playground/locales/ca_AD/ca_AD_test.go
new file mode 100644
index 000000000..4056866e7
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_AD/ca_AD_test.go
@@ -0,0 +1,1120 @@
+package ca_AD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_AD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca_ES/ca_ES.go b/vendor/github.com/go-playground/locales/ca_ES/ca_ES.go
new file mode 100644
index 000000000..7b5383916
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_ES/ca_ES.go
@@ -0,0 +1,593 @@
+package ca_ES
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca_ES struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca_ES' locale
+func New() locales.Translator {
+ return &ca_ES{
+ locale: "ca_ES",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "CLST": "Hora d’estiu de Xile", "WIT": "Hora de l’est d’Indonèsia", "HKT": "Hora estàndard de Hong Kong", "HAST": "Hora estàndard de Hawaii-Aleutianes", "UYST": "Hora d’estiu de l’Uruguai", "GYT": "Hora de Guyana", "CHAST": "Hora estàndard de Chatham", "SAST": "Hora estàndard del sud de l’Àfrica", "WAT": "Hora estàndard de l’Àfrica Occidental", "WARST": "Hora d’estiu de l’oest de l’Argentina", "ADT": "Hora d’estiu de l’Atlàntic", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "MESZ": "Hora d’estiu del Centre d’Europa", "ACDT": "Hora d’estiu d’Austràlia Central", "HKST": "Hora d’estiu de Hong Kong", "WART": "Hora estàndard de l’oest de l’Argentina", "HNCU": "Hora estàndard de Cuba", "AWDT": "Hora d’estiu d’Austràlia Occidental", "NZDT": "Hora d’estiu de Nova Zelanda", "ECT": "Hora de l’Equador", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "GFT": "Hora de la Guaiana Francesa", "MST": "Hora estàndard de Macau", "EAT": "Hora de l’Àfrica Oriental", "ART": "Hora estàndard de l’Argentina", "ChST": "Hora de Chamorro", "CDT": "Hora d’estiu central d’Amèrica del Nord", "WAST": "Hora d’estiu de l’Àfrica Occidental", "∅∅∅": "Hora d’estiu del Perú", "GMT": "Hora del Meridià de Greenwich", "AEDT": "Hora d’estiu d’Austràlia Oriental", "MEZ": "Hora estàndard del Centre d’Europa", "HAT": "Hora d’estiu de Terranova", "CST": "Hora estàndard central d’Amèrica del Nord", "AST": "Hora estàndard de l’Atlàntic", "WIB": "Hora de l’oest d’Indonèsia", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "LHDT": "Horari d’estiu de Lord Howe", "WITA": "Hora central d’Indonèsia", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "UYT": "Hora estàndard de l’Uruguai", "AKST": "Hora estàndard d’Alaska", "VET": "Hora de Veneçuela", "WESZ": "Hora d’estiu de l’Oest d’Europa", "JST": "Hora estàndard del Japó", "EST": "Hora estàndard oriental d’Amèrica del Nord", "TMT": "Hora estàndard del Turkmenistan", "CAT": "Hora de l’Àfrica Central", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "ACST": "Hora estàndard d’Austràlia Central", "WEZ": "Hora estàndard de l’Oest d’Europa", "MYT": "Hora de Malàisia", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "CLT": "Hora estàndard de Xile", "TMST": "Hora d’estiu del Turkmenistan", "COT": "Hora estàndard de Colòmbia", "OESZ": "Hora d’estiu de l’Est d’Europa", "HECU": "Hora d’estiu de Cuba", "SGT": "Hora de Singapur", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "LHST": "Hora estàndard de Lord Howe", "COST": "Hora d’estiu de Colòmbia", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "AWST": "Hora estàndard d’Austràlia Occidental", "PST": "Hora estàndard del Pacífic", "BOT": "Hora de Bolívia", "AKDT": "Hora d’estiu d’Alaska", "IST": "Hora estàndard de l’Índia", "HNT": "Hora estàndard de Terranova", "MDT": "Hora d’estiu de Macau", "SRT": "Hora de Surinam", "OEZ": "Hora estàndard de l’Est d’Europa", "CHADT": "Hora d’estiu de Chatham", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "ARST": "Hora d’estiu de l’Argentina", "PDT": "Hora d’estiu del Pacífic", "AEST": "Hora estàndard d’Austràlia Oriental", "JDT": "Hora d’estiu del Japó", "BT": "Hora de Bhutan", "NZST": "Hora estàndard de Nova Zelanda"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca_ES) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca_ES'
+func (ca *ca_ES) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca_ES'
+func (ca *ca_ES) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca_ES'
+func (ca *ca_ES) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca_ES'
+func (ca *ca_ES) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca_ES'
+func (ca *ca_ES) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca_ES'
+func (ca *ca_ES) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca_ES) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca_ES) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca_ES) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca_ES) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca_ES) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca_ES) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca_ES) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca_ES) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca_ES) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca_ES) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca_ES) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca_ES) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca_ES) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca_ES) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca_ES) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca_ES) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca_ES) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca_ES' and handles both Whole and Real numbers based on 'v'
+func (ca *ca_ES) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca_ES' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca_ES) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca_ES'
+func (ca *ca_ES) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca_ES'
+// in accounting notation.
+func (ca *ca_ES) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca_ES'
+func (ca *ca_ES) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca_ES/ca_ES_test.go b/vendor/github.com/go-playground/locales/ca_ES/ca_ES_test.go
new file mode 100644
index 000000000..6162c2478
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_ES/ca_ES_test.go
@@ -0,0 +1,1120 @@
+package ca_ES
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_ES"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA.go b/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA.go
new file mode 100644
index 000000000..9192dcd0e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA.go
@@ -0,0 +1,593 @@
+package ca_ES_VALENCIA
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca_ES_VALENCIA struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca_ES_VALENCIA' locale
+func New() locales.Translator {
+ return &ca_ES_VALENCIA{
+ locale: "ca_ES_VALENCIA",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"SRT": "Hora de Surinam", "WIT": "Hora de l’est d’Indonèsia", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "AST": "Hora estàndard de l’Atlàntic", "NZST": "Hora estàndard de Nova Zelanda", "ACDT": "Hora d’estiu d’Austràlia Central", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "HKT": "Hora estàndard de Hong Kong", "HAST": "Hora estàndard de Hawaii-Aleutianes", "ART": "Hora estàndard de l’Argentina", "HNCU": "Hora estàndard de Cuba", "ADT": "Hora d’estiu de l’Atlàntic", "WAST": "Hora d’estiu de l’Àfrica Occidental", "SGT": "Hora de Singapur", "CLT": "Hora estàndard de Xile", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "VET": "Hora de Veneçuela", "AWST": "Hora estàndard d’Austràlia Occidental", "ECT": "Hora de l’Equador", "MEZ": "Hora estàndard del Centre d’Europa", "MESZ": "Hora d’estiu del Centre d’Europa", "WEZ": "Hora estàndard de l’Oest d’Europa", "MYT": "Hora de Malàisia", "TMT": "Hora estàndard del Turkmenistan", "SAST": "Hora estàndard del sud de l’Àfrica", "HNT": "Hora estàndard de Terranova", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "CAT": "Hora de l’Àfrica Central", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "WIB": "Hora de l’oest d’Indonèsia", "HAT": "Hora d’estiu de Terranova", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "JST": "Hora estàndard del Japó", "AKST": "Hora estàndard d’Alaska", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "HKST": "Hora d’estiu de Hong Kong", "CLST": "Hora d’estiu de Xile", "BOT": "Hora de Bolívia", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "LHST": "Hora estàndard de Lord Howe", "OESZ": "Hora d’estiu de l’Est d’Europa", "GMT": "Hora del Meridià de Greenwich", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "COT": "Hora estàndard de Colòmbia", "HECU": "Hora d’estiu de Cuba", "CHAST": "Hora estàndard de Chatham", "GFT": "Hora de la Guaiana Francesa", "ACST": "Hora estàndard d’Austràlia Central", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "TMST": "Hora d’estiu del Turkmenistan", "∅∅∅": "Hora d’estiu de Brasília", "AEST": "Hora estàndard d’Austràlia Oriental", "OEZ": "Hora estàndard de l’Est d’Europa", "ChST": "Hora de Chamorro", "BT": "Hora de Bhutan", "LHDT": "Horari d’estiu de Lord Howe", "PDT": "Hora d’estiu del Pacífic", "AWDT": "Hora d’estiu d’Austràlia Occidental", "CST": "Hora estàndard central d’Amèrica del Nord", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "WESZ": "Hora d’estiu de l’Oest d’Europa", "JDT": "Hora d’estiu del Japó", "WART": "Hora estàndard de l’oest de l’Argentina", "WARST": "Hora d’estiu de l’oest de l’Argentina", "WITA": "Hora central d’Indonèsia", "EAT": "Hora de l’Àfrica Oriental", "UYT": "Hora estàndard de l’Uruguai", "UYST": "Hora d’estiu de l’Uruguai", "CHADT": "Hora d’estiu de Chatham", "AEDT": "Hora d’estiu d’Austràlia Oriental", "WAT": "Hora estàndard de l’Àfrica Occidental", "AKDT": "Hora d’estiu d’Alaska", "ARST": "Hora d’estiu de l’Argentina", "GYT": "Hora de Guyana", "EST": "Hora estàndard oriental d’Amèrica del Nord", "IST": "Hora estàndard de l’Índia", "HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "PST": "Hora estàndard del Pacífic", "CDT": "Hora d’estiu central d’Amèrica del Nord", "NZDT": "Hora d’estiu de Nova Zelanda", "COST": "Hora d’estiu de Colòmbia"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca_ES_VALENCIA) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca_ES_VALENCIA) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca_ES_VALENCIA) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca_ES_VALENCIA) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca_ES_VALENCIA) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca_ES_VALENCIA) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca_ES_VALENCIA) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca_ES_VALENCIA) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca_ES_VALENCIA) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca_ES_VALENCIA) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca_ES_VALENCIA) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca_ES_VALENCIA) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca_ES_VALENCIA) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca_ES_VALENCIA) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca_ES_VALENCIA) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca_ES_VALENCIA) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca_ES_VALENCIA) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca_ES_VALENCIA) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca_ES_VALENCIA' and handles both Whole and Real numbers based on 'v'
+func (ca *ca_ES_VALENCIA) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca_ES_VALENCIA' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca_ES_VALENCIA) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca_ES_VALENCIA'
+// in accounting notation.
+func (ca *ca_ES_VALENCIA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca_ES_VALENCIA'
+func (ca *ca_ES_VALENCIA) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go b/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go
new file mode 100644
index 000000000..390cffb44
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_ES_VALENCIA/ca_ES_VALENCIA_test.go
@@ -0,0 +1,1120 @@
+package ca_ES_VALENCIA
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_ES_VALENCIA"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca_FR/ca_FR.go b/vendor/github.com/go-playground/locales/ca_FR/ca_FR.go
new file mode 100644
index 000000000..dff94a0ec
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_FR/ca_FR.go
@@ -0,0 +1,593 @@
+package ca_FR
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca_FR struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca_FR' locale
+func New() locales.Translator {
+ return &ca_FR{
+ locale: "ca_FR",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "F", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"VET": "Hora de Veneçuela", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "MST": "Hora estàndard de muntanya d’Amèrica del Nord", "AEST": "Hora estàndard d’Austràlia Oriental", "WEZ": "Hora estàndard de l’Oest d’Europa", "NZDT": "Hora d’estiu de Nova Zelanda", "EST": "Hora estàndard oriental d’Amèrica del Nord", "MESZ": "Hora d’estiu del Centre d’Europa", "HKT": "Hora estàndard de Hong Kong", "CST": "Hora estàndard central d’Amèrica del Nord", "CDT": "Hora d’estiu central d’Amèrica del Nord", "HNT": "Hora estàndard de Terranova", "CLT": "Hora estàndard de Xile", "HKST": "Hora d’estiu de Hong Kong", "IST": "Hora estàndard de l’Índia", "WITA": "Hora central d’Indonèsia", "COT": "Hora estàndard de Colòmbia", "UYT": "Hora estàndard de l’Uruguai", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "ADT": "Hora d’estiu de l’Atlàntic", "WAT": "Hora estàndard de l’Àfrica Occidental", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "ACST": "Hora estàndard d’Austràlia Central", "LHST": "Hora estàndard de Lord Howe", "UYST": "Hora d’estiu de l’Uruguai", "CHAST": "Hora estàndard de Chatham", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "CAT": "Hora de l’Àfrica Central", "AWST": "Hora estàndard d’Austràlia Occidental", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "AWDT": "Hora d’estiu d’Austràlia Occidental", "AKDT": "Hora d’estiu d’Alaska", "SGT": "Hora de Singapur", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "SRT": "Hora de Surinam", "HECU": "Hora d’estiu de Cuba", "PST": "Hora estàndard del Pacífic", "WAST": "Hora d’estiu de l’Àfrica Occidental", "WARST": "Hora d’estiu de l’oest de l’Argentina", "OEZ": "Hora estàndard de l’Est d’Europa", "AEDT": "Hora d’estiu d’Austràlia Oriental", "MDT": "Hora d’estiu de muntanya d’Amèrica del Nord", "BOT": "Hora de Bolívia", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "WIT": "Hora de l’est d’Indonèsia", "TMST": "Hora d’estiu del Turkmenistan", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "WIB": "Hora de l’oest d’Indonèsia", "GFT": "Hora de la Guaiana Francesa", "HAST": "Hora estàndard de Hawaii-Aleutianes", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "HNCU": "Hora estàndard de Cuba", "WESZ": "Hora d’estiu de l’Oest d’Europa", "AST": "Hora estàndard de l’Atlàntic", "SAST": "Hora estàndard del sud de l’Àfrica", "ACDT": "Hora d’estiu d’Austràlia Central", "WART": "Hora estàndard de l’oest de l’Argentina", "ART": "Hora estàndard de l’Argentina", "GYT": "Hora de Guyana", "PDT": "Hora d’estiu del Pacífic", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "EAT": "Hora de l’Àfrica Oriental", "JST": "Hora estàndard del Japó", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "ChST": "Hora de Chamorro", "HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "AKST": "Hora estàndard d’Alaska", "ECT": "Hora de l’Equador", "MEZ": "Hora estàndard del Centre d’Europa", "CLST": "Hora d’estiu de Xile", "TMT": "Hora estàndard del Turkmenistan", "GMT": "Hora del Meridià de Greenwich", "MYT": "Hora de Malàisia", "OESZ": "Hora d’estiu de l’Est d’Europa", "BT": "Hora de Bhutan", "JDT": "Hora d’estiu del Japó", "HAT": "Hora d’estiu de Terranova", "ARST": "Hora d’estiu de l’Argentina", "CHADT": "Hora d’estiu de Chatham", "∅∅∅": "Hora d’estiu de Brasília", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "COST": "Hora d’estiu de Colòmbia", "NZST": "Hora estàndard de Nova Zelanda", "LHDT": "Horari d’estiu de Lord Howe"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca_FR) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca_FR'
+func (ca *ca_FR) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca_FR'
+func (ca *ca_FR) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca_FR'
+func (ca *ca_FR) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca_FR'
+func (ca *ca_FR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca_FR'
+func (ca *ca_FR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca_FR'
+func (ca *ca_FR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca_FR) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca_FR) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca_FR) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca_FR) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca_FR) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca_FR) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca_FR) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca_FR) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca_FR) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca_FR) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca_FR) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca_FR) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca_FR) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca_FR) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca_FR) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca_FR) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca_FR) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca_FR' and handles both Whole and Real numbers based on 'v'
+func (ca *ca_FR) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca_FR' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca_FR) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca_FR'
+func (ca *ca_FR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca_FR'
+// in accounting notation.
+func (ca *ca_FR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca_FR'
+func (ca *ca_FR) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca_FR/ca_FR_test.go b/vendor/github.com/go-playground/locales/ca_FR/ca_FR_test.go
new file mode 100644
index 000000000..5cdbcf165
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_FR/ca_FR_test.go
@@ -0,0 +1,1120 @@
+package ca_FR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_FR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ca_IT/ca_IT.go b/vendor/github.com/go-playground/locales/ca_IT/ca_IT.go
new file mode 100644
index 000000000..121fec4f2
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_IT/ca_IT.go
@@ -0,0 +1,593 @@
+package ca_IT
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ca_IT struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ca_IT' locale
+func New() locales.Translator {
+ return &ca_IT{
+ locale: "ca_IT",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsRange: []locales.PluralRule{6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: " )",
+ monthsAbbreviated: []string{"", "de gen.", "de febr.", "de març", "d’abr.", "de maig", "de juny", "de jul.", "d’ag.", "de set.", "d’oct.", "de nov.", "de des."},
+ monthsNarrow: []string{"", "GN", "FB", "MÇ", "AB", "MG", "JN", "JL", "AG", "ST", "OC", "NV", "DS"},
+ monthsWide: []string{"", "de gener", "de febrer", "de març", "d’abril", "de maig", "de juny", "de juliol", "d’agost", "de setembre", "d’octubre", "de novembre", "de desembre"},
+ daysAbbreviated: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysNarrow: []string{"dg", "dl", "dt", "dc", "dj", "dv", "ds"},
+ daysShort: []string{"dg.", "dl.", "dt.", "dc.", "dj.", "dv.", "ds."},
+ daysWide: []string{"diumenge", "dilluns", "dimarts", "dimecres", "dijous", "divendres", "dissabte"},
+ periodsAbbreviated: []string{"a. m.", "p. m."},
+ periodsNarrow: []string{"a. m.", "p. m."},
+ periodsWide: []string{"a. m.", "p. m."},
+ erasAbbreviated: []string{"aC", "dC"},
+ erasNarrow: []string{"aC", "dC"},
+ erasWide: []string{"abans de Crist", "després de Crist"},
+ timezones: map[string]string{"MYT": "Hora de Malàisia", "HEPM": "Hora d’estiu de Saint-Pierre i Miquelon", "HADT": "Hora d’estiu de Hawaii-Aleutianes", "ARST": "Hora d’estiu de l’Argentina", "OEZ": "Hora estàndard de l’Est d’Europa", "CHADT": "Hora d’estiu de Chatham", "SGT": "Hora de Singapur", "MEZ": "Hora estàndard del Centre d’Europa", "WART": "Hora estàndard de l’oest de l’Argentina", "HNPM": "Hora estàndard de Saint-Pierre i Miquelon", "EAT": "Hora de l’Àfrica Oriental", "CLST": "Hora d’estiu de Xile", "AWST": "Hora estàndard d’Austràlia Occidental", "BOT": "Hora de Bolívia", "CAT": "Hora de l’Àfrica Central", "WAST": "Hora d’estiu de l’Àfrica Occidental", "LHST": "Hora estàndard de Lord Howe", "MDT": "Hora d’estiu de Macau", "HAST": "Hora estàndard de Hawaii-Aleutianes", "ECT": "Hora de l’Equador", "HKST": "Hora d’estiu de Hong Kong", "CLT": "Hora estàndard de Xile", "GYT": "Hora de Guyana", "HNCU": "Hora estàndard de Cuba", "HNPMX": "Hora estàndard del Pacífic de Mèxic", "WIB": "Hora de l’oest d’Indonèsia", "JDT": "Hora d’estiu del Japó", "HEOG": "Hora d’estiu de l’Oest de Grenlàndia", "HKT": "Hora estàndard de Hong Kong", "WITA": "Hora central d’Indonèsia", "HAT": "Hora d’estiu de Terranova", "AEST": "Hora estàndard d’Austràlia Oriental", "GFT": "Hora de la Guaiana Francesa", "BT": "Hora de Bhutan", "ACDT": "Hora d’estiu d’Austràlia Central", "TMST": "Hora d’estiu del Turkmenistan", "HECU": "Hora d’estiu de Cuba", "OESZ": "Hora d’estiu de l’Est d’Europa", "WESZ": "Hora d’estiu de l’Oest d’Europa", "ACWDT": "Hora d’estiu d’Austràlia centre-occidental", "MESZ": "Hora d’estiu del Centre d’Europa", "WARST": "Hora d’estiu de l’oest de l’Argentina", "HENOMX": "Hora d’estiu del nord-oest de Mèxic", "COST": "Hora d’estiu de Colòmbia", "CHAST": "Hora estàndard de Chatham", "∅∅∅": "∅∅∅", "SAST": "Hora estàndard del sud de l’Àfrica", "NZST": "Hora estàndard de Nova Zelanda", "ACST": "Hora estàndard d’Austràlia Central", "IST": "Hora estàndard de l’Índia", "WIT": "Hora de l’est d’Indonèsia", "NZDT": "Hora d’estiu de Nova Zelanda", "AKST": "Hora estàndard d’Alaska", "HNEG": "Hora estàndard de l’Est de Grenlàndia", "HNOG": "Hora estàndard de l’Oest de Grenlàndia", "EDT": "Hora d’estiu oriental d’Amèrica del Nord", "ChST": "Hora de Chamorro", "TMT": "Hora estàndard del Turkmenistan", "PDT": "Hora d’estiu del Pacífic", "EST": "Hora estàndard oriental d’Amèrica del Nord", "GMT": "Hora del Meridià de Greenwich", "AEDT": "Hora d’estiu d’Austràlia Oriental", "WAT": "Hora estàndard de l’Àfrica Occidental", "JST": "Hora estàndard del Japó", "LHDT": "Horari d’estiu de Lord Howe", "SRT": "Hora de Surinam", "MST": "Hora estàndard de Macau", "UYST": "Hora d’estiu de l’Uruguai", "AST": "Hora estàndard de l’Atlàntic", "HNT": "Hora estàndard de Terranova", "ADT": "Hora d’estiu de l’Atlàntic", "AWDT": "Hora d’estiu d’Austràlia Occidental", "HEPMX": "Hora d’estiu del Pacífic de Mèxic", "WEZ": "Hora estàndard de l’Oest d’Europa", "AKDT": "Hora d’estiu d’Alaska", "HEEG": "Hora d’estiu de l’Est de Grenlàndia", "HNNOMX": "Hora estàndard del nord-oest de Mèxic", "ART": "Hora estàndard de l’Argentina", "UYT": "Hora estàndard de l’Uruguai", "ACWST": "Hora estàndard d’Austràlia centre-occidental", "VET": "Hora de Veneçuela", "COT": "Hora estàndard de Colòmbia", "PST": "Hora estàndard del Pacífic", "CST": "Hora estàndard central d’Amèrica del Nord", "CDT": "Hora d’estiu central d’Amèrica del Nord"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ca *ca_IT) Locale() string {
+ return ca.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ca_IT'
+func (ca *ca_IT) PluralsCardinal() []locales.PluralRule {
+ return ca.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ca_IT'
+func (ca *ca_IT) PluralsOrdinal() []locales.PluralRule {
+ return ca.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ca_IT'
+func (ca *ca_IT) PluralsRange() []locales.PluralRule {
+ return ca.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ca_IT'
+func (ca *ca_IT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ca_IT'
+func (ca *ca_IT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 || n == 3 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 4 {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ca_IT'
+func (ca *ca_IT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ca *ca_IT) MonthAbbreviated(month time.Month) string {
+ return ca.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ca *ca_IT) MonthsAbbreviated() []string {
+ return ca.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ca *ca_IT) MonthNarrow(month time.Month) string {
+ return ca.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ca *ca_IT) MonthsNarrow() []string {
+ return ca.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ca *ca_IT) MonthWide(month time.Month) string {
+ return ca.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ca *ca_IT) MonthsWide() []string {
+ return ca.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ca *ca_IT) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ca.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ca *ca_IT) WeekdaysAbbreviated() []string {
+ return ca.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ca *ca_IT) WeekdayNarrow(weekday time.Weekday) string {
+ return ca.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ca *ca_IT) WeekdaysNarrow() []string {
+ return ca.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ca *ca_IT) WeekdayShort(weekday time.Weekday) string {
+ return ca.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ca *ca_IT) WeekdaysShort() []string {
+ return ca.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ca *ca_IT) WeekdayWide(weekday time.Weekday) string {
+ return ca.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ca *ca_IT) WeekdaysWide() []string {
+ return ca.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ca *ca_IT) Decimal() string {
+ return ca.decimal
+}
+
+// Group returns the group of number
+func (ca *ca_IT) Group() string {
+ return ca.group
+}
+
+// Group returns the minus sign of number
+func (ca *ca_IT) Minus() string {
+ return ca.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ca_IT' and handles both Whole and Real numbers based on 'v'
+func (ca *ca_IT) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ca_IT' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ca *ca_IT) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ca.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ca_IT'
+func (ca *ca_IT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ca.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ca.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ca_IT'
+// in accounting notation.
+func (ca *ca_IT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ca.currencies[currency]
+ l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ca.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ca.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ca.currencyNegativePrefix[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ca.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ca.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ca.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ca.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ca.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ca_IT'
+func (ca *ca_IT) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ca.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ca.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ca_IT/ca_IT_test.go b/vendor/github.com/go-playground/locales/ca_IT/ca_IT_test.go
new file mode 100644
index 000000000..2a1a3b33c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ca_IT/ca_IT_test.go
@@ -0,0 +1,1120 @@
+package ca_IT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ca_IT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ccp/ccp.go b/vendor/github.com/go-playground/locales/ccp/ccp.go
new file mode 100644
index 000000000..8197935b8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp/ccp.go
@@ -0,0 +1,640 @@
+package ccp
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ccp struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ccp' locale
+func New() locales.Translator {
+ return &ccp{
+ locale: "ccp",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "৳", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "𑄎𑄚𑄪", "𑄜𑄬𑄛𑄴", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴"},
+ monthsNarrow: []string{"", "𑄎", "𑄜𑄬", "𑄟", "𑄃𑄬", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪", "𑄃", "𑄥𑄬", "𑄃𑄧", "𑄚𑄧", "𑄓𑄨"},
+ monthsWide: []string{"", "𑄎𑄚𑄪𑄠𑄢𑄨", "𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴"},
+ daysAbbreviated: []string{"𑄢𑄧𑄝𑄨", "𑄥𑄧𑄟𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴", "𑄝𑄪𑄖𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴", "𑄥𑄧𑄚𑄨"},
+ daysNarrow: []string{"𑄢𑄧", "𑄥𑄧", "𑄟𑄧", "𑄝𑄪", "𑄝𑄳𑄢𑄨", "𑄥𑄪", "𑄥𑄧"},
+ daysWide: []string{"𑄢𑄧𑄝𑄨𑄝𑄢𑄴", "𑄥𑄧𑄟𑄴𑄝𑄢𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴", "𑄝𑄪𑄖𑄴𑄝𑄢𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴", "𑄥𑄧𑄚𑄨𑄝𑄢𑄴"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"ACST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GYT": "𑄉𑄪𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "PDT": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SAST": "𑄘𑄧𑄉𑄨𑄚𑄴 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SGT": "𑄥𑄨𑄁𑄉𑄛𑄪𑄢 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MESZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HAT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MST": "𑄟𑄇𑄃𑄮 𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMT": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BT": "𑄞𑄪𑄑𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLT": "𑄌𑄨𑄣𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLST": "𑄌𑄨𑄣𑄨 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ChST": "𑄌𑄟𑄬𑄢𑄮 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "JST": "𑄎𑄛𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAT": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MYT": "𑄟𑄣𑄴𑄠𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "LHST": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SRT": "𑄥𑄪𑄢𑄨𑄚𑄟𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OEZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CST": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AST": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYT": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WEZ": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EST": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKT": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WART": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "∅∅∅": "𑄛𑄬𑄢𑄪 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNNOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMST": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WIT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "GMT": "𑄉𑄳𑄢𑄨𑄚𑄨𑄌𑄴 𑄟𑄨𑄚𑄴 𑄑𑄬𑄟𑄴", "AKDT": "𑄃𑄣𑄌𑄴𑄇 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "HKST": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZDT": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HENOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MDT": "𑄟𑄇𑄃𑄮 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CAT": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "EAT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "HNCU": "𑄇𑄨𑄃𑄪𑄝 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COST": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HECU": "𑄇𑄨𑄃𑄪𑄝 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "PST": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "VET": "𑄞𑄬𑄚𑄬𑄎𑄪𑄠𑄬𑄣 𑄃𑄧𑄇𑄴𑄖𑄧", "WITA": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄢𑄳𑄦 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "HAST": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HADT": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WESZ": "𑄛𑄧𑄏𑄬𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GFT": "𑄜𑄧𑄢𑄥𑄨 𑄉𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "MEZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WARST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ARST": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COT": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ECT": "𑄃𑄨𑄇𑄪𑄠𑄬𑄓𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OESZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ADT": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BOT": "𑄝𑄮𑄣𑄨𑄞𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "AKST": "𑄃𑄣𑄌𑄴𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EDT": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "LHDT": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ART": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYST": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHADT": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "IST": "𑄃𑄨𑄚𑄴𑄘𑄨𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CDT": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "WIB": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "JDT": "𑄎𑄛𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZST": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHAST": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ccp *ccp) Locale() string {
+ return ccp.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ccp'
+func (ccp *ccp) PluralsCardinal() []locales.PluralRule {
+ return ccp.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ccp'
+func (ccp *ccp) PluralsOrdinal() []locales.PluralRule {
+ return ccp.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ccp'
+func (ccp *ccp) PluralsRange() []locales.PluralRule {
+ return ccp.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ccp'
+func (ccp *ccp) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ccp'
+func (ccp *ccp) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ccp'
+func (ccp *ccp) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ccp *ccp) MonthAbbreviated(month time.Month) string {
+ return ccp.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ccp *ccp) MonthsAbbreviated() []string {
+ return ccp.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ccp *ccp) MonthNarrow(month time.Month) string {
+ return ccp.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ccp *ccp) MonthsNarrow() []string {
+ return ccp.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ccp *ccp) MonthWide(month time.Month) string {
+ return ccp.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ccp *ccp) MonthsWide() []string {
+ return ccp.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ccp *ccp) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ccp.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ccp *ccp) WeekdaysAbbreviated() []string {
+ return ccp.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ccp *ccp) WeekdayNarrow(weekday time.Weekday) string {
+ return ccp.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ccp *ccp) WeekdaysNarrow() []string {
+ return ccp.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ccp *ccp) WeekdayShort(weekday time.Weekday) string {
+ return ccp.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ccp *ccp) WeekdaysShort() []string {
+ return ccp.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ccp *ccp) WeekdayWide(weekday time.Weekday) string {
+ return ccp.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ccp *ccp) WeekdaysWide() []string {
+ return ccp.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ccp *ccp) Decimal() string {
+ return ccp.decimal
+}
+
+// Group returns the group of number
+func (ccp *ccp) Group() string {
+ return ccp.group
+}
+
+// Group returns the minus sign of number
+func (ccp *ccp) Minus() string {
+ return ccp.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ccp' and handles both Whole and Real numbers based on 'v'
+func (ccp *ccp) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ccp' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ccp *ccp) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ccp.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ccp'
+func (ccp *ccp) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ccp'
+// in accounting notation.
+func (ccp *ccp) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ccp.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ccp'
+func (ccp *ccp) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ccp'
+func (ccp *ccp) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ccp'
+func (ccp *ccp) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ccp'
+func (ccp *ccp) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ccp.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ccp'
+func (ccp *ccp) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ccp'
+func (ccp *ccp) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ccp'
+func (ccp *ccp) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ccp'
+func (ccp *ccp) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ccp.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ccp/ccp_test.go b/vendor/github.com/go-playground/locales/ccp/ccp_test.go
new file mode 100644
index 000000000..0d3162e73
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp/ccp_test.go
@@ -0,0 +1,1120 @@
+package ccp
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ccp"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD.go b/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD.go
new file mode 100644
index 000000000..7bc72cf30
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD.go
@@ -0,0 +1,640 @@
+package ccp_BD
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ccp_BD struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ccp_BD' locale
+func New() locales.Translator {
+ return &ccp_BD{
+ locale: "ccp_BD",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "𑄎𑄚𑄪", "𑄜𑄬𑄛𑄴", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴"},
+ monthsNarrow: []string{"", "𑄎", "𑄜𑄬", "𑄟", "𑄃𑄬", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪", "𑄃", "𑄥𑄬", "𑄃𑄧", "𑄚𑄧", "𑄓𑄨"},
+ monthsWide: []string{"", "𑄎𑄚𑄪𑄠𑄢𑄨", "𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴"},
+ daysAbbreviated: []string{"𑄢𑄧𑄝𑄨", "𑄥𑄧𑄟𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴", "𑄝𑄪𑄖𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴", "𑄥𑄧𑄚𑄨"},
+ daysNarrow: []string{"𑄢𑄧", "𑄥𑄧", "𑄟𑄧", "𑄝𑄪", "𑄝𑄳𑄢𑄨", "𑄥𑄪", "𑄥𑄧"},
+ daysWide: []string{"𑄢𑄧𑄝𑄨𑄝𑄢𑄴", "𑄥𑄧𑄟𑄴𑄝𑄢𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴", "𑄝𑄪𑄖𑄴𑄝𑄢𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴", "𑄥𑄧𑄚𑄨𑄝𑄢𑄴"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"∅∅∅": "𑄃𑄳𑄠𑄟𑄎𑄧𑄚𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧 𑄃𑄧𑄇𑄴𑄖𑄧", "ARST": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKT": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "LHDT": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMT": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAT": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MESZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WART": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLT": "𑄌𑄨𑄣𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OEZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "JST": "𑄎𑄛𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AKST": "𑄃𑄣𑄌𑄴𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SGT": "𑄥𑄨𑄁𑄉𑄛𑄪𑄢 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "PST": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AST": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MDT": "𑄦𑄨𑄣𑄧𑄧𑄱 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BT": "𑄞𑄪𑄑𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZDT": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "VET": "𑄞𑄬𑄚𑄬𑄎𑄪𑄠𑄬𑄣 𑄃𑄧𑄇𑄴𑄖𑄧", "WIT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "UYST": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MST": "𑄦𑄨𑄣𑄧𑄧𑄱 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MEZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HADT": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYT": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNCU": "𑄇𑄨𑄃𑄪𑄝 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WIB": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "NZST": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "IST": "𑄃𑄨𑄚𑄴𑄘𑄨𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OESZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SRT": "𑄥𑄪𑄢𑄨𑄚𑄟𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHAST": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHADT": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BOT": "𑄝𑄮𑄣𑄨𑄞𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "LHST": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WITA": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄢𑄳𑄦 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "COST": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WESZ": "𑄛𑄧𑄏𑄬𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "JDT": "𑄎𑄛𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ECT": "𑄃𑄨𑄇𑄪𑄠𑄬𑄓𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WARST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HENOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ART": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GYT": "𑄉𑄪𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "PDT": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ADT": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GFT": "𑄜𑄧𑄢𑄥𑄨 𑄉𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "ChST": "𑄌𑄟𑄬𑄢𑄮 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MYT": "𑄟𑄣𑄴𑄠𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "EST": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HAST": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COT": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKST": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HAT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CAT": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "EAT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "CLST": "𑄌𑄨𑄣𑄨 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HECU": "𑄇𑄨𑄃𑄪𑄝 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CDT": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "AKDT": "𑄃𑄣𑄌𑄴𑄇 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "EDT": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GMT": "𑄉𑄳𑄢𑄨𑄚𑄨𑄌𑄴 𑄟𑄨𑄚𑄴 𑄑𑄬𑄟𑄴", "WAST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNNOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CST": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SAST": "𑄘𑄧𑄉𑄨𑄚𑄴 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WEZ": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMST": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ccp *ccp_BD) Locale() string {
+ return ccp.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ccp_BD'
+func (ccp *ccp_BD) PluralsCardinal() []locales.PluralRule {
+ return ccp.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ccp_BD'
+func (ccp *ccp_BD) PluralsOrdinal() []locales.PluralRule {
+ return ccp.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ccp_BD'
+func (ccp *ccp_BD) PluralsRange() []locales.PluralRule {
+ return ccp.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ccp_BD'
+func (ccp *ccp_BD) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ccp_BD'
+func (ccp *ccp_BD) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ccp_BD'
+func (ccp *ccp_BD) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ccp *ccp_BD) MonthAbbreviated(month time.Month) string {
+ return ccp.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ccp *ccp_BD) MonthsAbbreviated() []string {
+ return ccp.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ccp *ccp_BD) MonthNarrow(month time.Month) string {
+ return ccp.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ccp *ccp_BD) MonthsNarrow() []string {
+ return ccp.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ccp *ccp_BD) MonthWide(month time.Month) string {
+ return ccp.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ccp *ccp_BD) MonthsWide() []string {
+ return ccp.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ccp *ccp_BD) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ccp.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ccp *ccp_BD) WeekdaysAbbreviated() []string {
+ return ccp.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ccp *ccp_BD) WeekdayNarrow(weekday time.Weekday) string {
+ return ccp.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ccp *ccp_BD) WeekdaysNarrow() []string {
+ return ccp.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ccp *ccp_BD) WeekdayShort(weekday time.Weekday) string {
+ return ccp.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ccp *ccp_BD) WeekdaysShort() []string {
+ return ccp.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ccp *ccp_BD) WeekdayWide(weekday time.Weekday) string {
+ return ccp.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ccp *ccp_BD) WeekdaysWide() []string {
+ return ccp.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ccp *ccp_BD) Decimal() string {
+ return ccp.decimal
+}
+
+// Group returns the group of number
+func (ccp *ccp_BD) Group() string {
+ return ccp.group
+}
+
+// Group returns the minus sign of number
+func (ccp *ccp_BD) Minus() string {
+ return ccp.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ccp_BD' and handles both Whole and Real numbers based on 'v'
+func (ccp *ccp_BD) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ccp_BD' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ccp *ccp_BD) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ccp.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ccp_BD'
+func (ccp *ccp_BD) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ccp_BD'
+// in accounting notation.
+func (ccp *ccp_BD) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ccp.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ccp.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ccp_BD'
+func (ccp *ccp_BD) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ccp.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD_test.go b/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD_test.go
new file mode 100644
index 000000000..bdacccaf5
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp_BD/ccp_BD_test.go
@@ -0,0 +1,1120 @@
+package ccp_BD
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ccp_BD"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN.go b/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN.go
new file mode 100644
index 000000000..c8e85375b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN.go
@@ -0,0 +1,640 @@
+package ccp_IN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ccp_IN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ccp_IN' locale
+func New() locales.Translator {
+ return &ccp_IN{
+ locale: "ccp_IN",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "𑄎𑄚𑄪", "𑄜𑄬𑄛𑄴", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄮𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄢𑄴"},
+ monthsNarrow: []string{"", "𑄎", "𑄜𑄬", "𑄟", "𑄃𑄬", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪", "𑄃", "𑄥𑄬", "𑄃𑄧", "𑄚𑄧", "𑄓𑄨"},
+ monthsWide: []string{"", "𑄎𑄚𑄪𑄠𑄢𑄨", "𑄜𑄬𑄛𑄴𑄝𑄳𑄢𑄪𑄠𑄢𑄨", "𑄟𑄢𑄴𑄌𑄧", "𑄃𑄬𑄛𑄳𑄢𑄨𑄣𑄴", "𑄟𑄬", "𑄎𑄪𑄚𑄴", "𑄎𑄪𑄣𑄭", "𑄃𑄉𑄧𑄌𑄴𑄑𑄴", "𑄥𑄬𑄛𑄴𑄑𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄃𑄧𑄇𑄴𑄑𑄬𑄝𑄧𑄢𑄴", "𑄚𑄧𑄞𑄬𑄟𑄴𑄝𑄧𑄢𑄴", "𑄓𑄨𑄥𑄬𑄟𑄴𑄝𑄧𑄢𑄴"},
+ daysAbbreviated: []string{"𑄢𑄧𑄝𑄨", "𑄥𑄧𑄟𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴", "𑄝𑄪𑄖𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴", "𑄥𑄧𑄚𑄨"},
+ daysNarrow: []string{"𑄢𑄧", "𑄥𑄧", "𑄟𑄧", "𑄝𑄪", "𑄝𑄳𑄢𑄨", "𑄥𑄪", "𑄥𑄧"},
+ daysWide: []string{"𑄢𑄧𑄝𑄨𑄝𑄢𑄴", "𑄥𑄧𑄟𑄴𑄝𑄢𑄴", "𑄟𑄧𑄁𑄉𑄧𑄣𑄴𑄝𑄢𑄴", "𑄝𑄪𑄖𑄴𑄝𑄢𑄴", "𑄝𑄳𑄢𑄨𑄥𑄪𑄛𑄴𑄝𑄢𑄴", "𑄥𑄪𑄇𑄴𑄇𑄮𑄢𑄴𑄝𑄢𑄴", "𑄥𑄧𑄚𑄨𑄝𑄢𑄴"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"AM", "PM"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"", ""},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"HADT": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "UYT": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SRT": "𑄥𑄪𑄢𑄨𑄚𑄟𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAT": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZDT": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GFT": "𑄜𑄧𑄢𑄥𑄨 𑄉𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "HAST": "𑄦𑄧𑄃𑄮𑄠𑄭-𑄃𑄣𑄬𑄃𑄪𑄖𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MST": "𑄦𑄨𑄣𑄧𑄧𑄱 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MDT": "𑄦𑄨𑄣𑄧𑄧𑄱 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CAT": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "CLT": "𑄌𑄨𑄣𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMT": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WEZ": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "NZST": "𑄚𑄨𑄃𑄪𑄎𑄨𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEOG": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WART": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HAT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "PST": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SGT": "𑄥𑄨𑄁𑄉𑄛𑄪𑄢 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AST": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WESZ": "𑄛𑄧𑄏𑄬𑄟𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BT": "𑄞𑄪𑄑𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MYT": "𑄟𑄣𑄴𑄠𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "LHDT": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OEZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ChST": "𑄌𑄟𑄬𑄢𑄮 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HECU": "𑄇𑄨𑄃𑄪𑄝 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COST": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GYT": "𑄉𑄪𑄠𑄚 𑄃𑄧𑄇𑄴𑄖𑄧", "AEST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AKDT": "𑄃𑄣𑄌𑄴𑄇 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "LHST": "𑄣𑄧𑄢𑄴𑄓𑄴 𑄦𑄤𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WITA": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄢𑄳𑄦 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "EAT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄃𑄧𑄇𑄴𑄖𑄧", "UYST": "𑄃𑄪𑄢𑄪𑄉𑄪𑄠𑄬 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNCU": "𑄇𑄨𑄃𑄪𑄝 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WIB": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WARST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EST": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄛𑄳𑄢𑄧𑄟𑄚𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "VET": "𑄞𑄬𑄚𑄬𑄎𑄪𑄠𑄬𑄣 𑄃𑄧𑄇𑄴𑄖𑄧", "HEPM": "𑄥𑄬𑄚𑄴𑄑𑄴 𑄛𑄨𑄠𑄬𑄢𑄴 𑄃𑄮 𑄟𑄨𑄇𑄬𑄣𑄧𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNNOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "GMT": "𑄉𑄳𑄢𑄨𑄚𑄨𑄌𑄴 𑄟𑄨𑄚𑄴 𑄑𑄬𑄟𑄴", "PDT": "𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AKST": "𑄃𑄣𑄌𑄴𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MEZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "COT": "𑄇𑄧𑄣𑄧𑄟𑄴𑄝𑄨𑄠 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "BOT": "𑄝𑄮𑄣𑄨𑄞𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "JST": "𑄎𑄛𑄚𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CLST": "𑄌𑄨𑄣𑄨 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "∅∅∅": "𑄝𑄳𑄢𑄥𑄨𑄣𑄨𑄠 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CDT": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄘𑄨𑄚𑄮𑄃𑄣𑄮 𑄃𑄧𑄇𑄴𑄖𑄧", "ADT": "𑄃𑄑𑄴𑄣𑄚𑄴𑄖𑄨𑄉𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WIT": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄚𑄴𑄘𑄮𑄚𑄬𑄥𑄨𑄠 𑄃𑄧𑄇𑄴𑄖𑄧", "ACST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKST": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "IST": "𑄃𑄨𑄚𑄴𑄘𑄨𑄠𑄬 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ART": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ARST": "𑄃𑄢𑄴𑄎𑄬𑄚𑄴𑄑𑄨𑄚 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CST": "𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ECT": "𑄃𑄨𑄇𑄪𑄠𑄬𑄓𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HEEG": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄉𑄳𑄢𑄨𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNT": "𑄚𑄨𑄃𑄪𑄜𑄃𑄪𑄚𑄴𑄣𑄳𑄠𑄚𑄴𑄓𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHADT": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HNPMX": "𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄚𑄴 𑄛𑄳𑄢𑄧𑄥𑄚𑄴𑄖𑄧 𑄟𑄧𑄦𑄥𑄉𑄧𑄢𑄧𑄢𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HKT": "𑄦𑄧𑄁 𑄇𑄧𑄁 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "OESZ": "𑄛𑄪𑄉𑄬𑄘𑄨 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AEDT": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄪𑄉𑄬𑄘𑄨 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "ACWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄃𑄏𑄧𑄣𑄴 𑄉𑄧𑄢𑄳𑄦𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "SAST": "𑄘𑄧𑄉𑄨𑄚𑄴 𑄃𑄜𑄳𑄢𑄨𑄇 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "WAST": "𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄃𑄜𑄳𑄢𑄨𑄇 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "JDT": "𑄎𑄛𑄚𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "EDT": "𑄛𑄪𑄉𑄮 𑄞𑄨𑄘𑄬𑄢𑄴 𑄘𑄨𑄚𑄮𑄃𑄣𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "MESZ": "𑄟𑄧𑄖𑄴𑄙𑄳𑄠 𑄃𑄨𑄃𑄪𑄢𑄮𑄝𑄮𑄢𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "HENOMX": "𑄃𑄪𑄖𑄴𑄖𑄮𑄢𑄴 𑄛𑄧𑄏𑄨𑄟𑄴 𑄟𑄬𑄇𑄴𑄥𑄨𑄇𑄮𑄢𑄴 𑄘𑄨𑄚𑄮𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "CHAST": "𑄌𑄳𑄠𑄗𑄟𑄴 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "AWST": "𑄃𑄧𑄌𑄴𑄑𑄳𑄢𑄬𑄣𑄨𑄠𑄧 𑄛𑄧𑄏𑄨𑄟𑄬𑄘𑄨 𑄟𑄚𑄧𑄇𑄴 𑄃𑄧𑄇𑄴𑄖𑄧", "TMST": "𑄖𑄪𑄢𑄴𑄇𑄴𑄟𑄬𑄚𑄨𑄌𑄴𑄖𑄚𑄴 𑄉𑄧𑄢𑄧𑄟𑄴𑄇𑄣𑄧𑄢𑄴 𑄃𑄧𑄇𑄴𑄖𑄧"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ccp *ccp_IN) Locale() string {
+ return ccp.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ccp_IN'
+func (ccp *ccp_IN) PluralsCardinal() []locales.PluralRule {
+ return ccp.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ccp_IN'
+func (ccp *ccp_IN) PluralsOrdinal() []locales.PluralRule {
+ return ccp.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ccp_IN'
+func (ccp *ccp_IN) PluralsRange() []locales.PluralRule {
+ return ccp.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ccp_IN'
+func (ccp *ccp_IN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ccp_IN'
+func (ccp *ccp_IN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ccp_IN'
+func (ccp *ccp_IN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ccp *ccp_IN) MonthAbbreviated(month time.Month) string {
+ return ccp.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ccp *ccp_IN) MonthsAbbreviated() []string {
+ return ccp.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ccp *ccp_IN) MonthNarrow(month time.Month) string {
+ return ccp.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ccp *ccp_IN) MonthsNarrow() []string {
+ return ccp.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ccp *ccp_IN) MonthWide(month time.Month) string {
+ return ccp.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ccp *ccp_IN) MonthsWide() []string {
+ return ccp.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ccp *ccp_IN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ccp.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ccp *ccp_IN) WeekdaysAbbreviated() []string {
+ return ccp.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ccp *ccp_IN) WeekdayNarrow(weekday time.Weekday) string {
+ return ccp.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ccp *ccp_IN) WeekdaysNarrow() []string {
+ return ccp.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ccp *ccp_IN) WeekdayShort(weekday time.Weekday) string {
+ return ccp.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ccp *ccp_IN) WeekdaysShort() []string {
+ return ccp.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ccp *ccp_IN) WeekdayWide(weekday time.Weekday) string {
+ return ccp.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ccp *ccp_IN) WeekdaysWide() []string {
+ return ccp.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ccp *ccp_IN) Decimal() string {
+ return ccp.decimal
+}
+
+// Group returns the group of number
+func (ccp *ccp_IN) Group() string {
+ return ccp.group
+}
+
+// Group returns the minus sign of number
+func (ccp *ccp_IN) Minus() string {
+ return ccp.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ccp_IN' and handles both Whole and Real numbers based on 'v'
+func (ccp *ccp_IN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ccp_IN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ccp *ccp_IN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ccp.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ccp_IN'
+func (ccp *ccp_IN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ccp.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ccp_IN'
+// in accounting notation.
+func (ccp *ccp_IN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ccp.currencies[currency]
+ l := len(s) + len(symbol) + 1
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ccp.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, ccp.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ccp.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ccp.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ccp.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ccp.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ccp_IN'
+func (ccp *ccp_IN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ccp.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ccp.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ccp.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ccp.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN_test.go b/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN_test.go
new file mode 100644
index 000000000..61f306538
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ccp_IN/ccp_IN_test.go
@@ -0,0 +1,1120 @@
+package ccp_IN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ccp_IN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ce/ce.go b/vendor/github.com/go-playground/locales/ce/ce.go
new file mode 100644
index 000000000..7e8f7684c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ce/ce.go
@@ -0,0 +1,461 @@
+package ce
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ce struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ce' locale
+func New() locales.Translator {
+ return &ce{
+ locale: "ce",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "₽", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
+ monthsNarrow: []string{"", "Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"},
+ monthsWide: []string{"", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"},
+ daysAbbreviated: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysNarrow: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysShort: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysWide: []string{"кӀира", "оршот", "шинара", "кхаара", "еара", "пӀераска", "шуот"},
+ erasAbbreviated: []string{"в. э. тӀ. я", "в. э"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ӏийса пайхамар вина де кхачале", "Ӏийса пайхамар вина дийнахь дуьйна"},
+ timezones: map[string]string{"UYST": "Уругвай, аьхкенан хан", "AEST": "Малхбален Австрали, стандартан хан", "JDT": "Япони, аьхкенан хан", "CAT": "Юккъера Африка", "TMST": "Туркменин аьхкенан хан", "AWST": "Малхбузен Австрали, стандартан хан", "HEOG": "Малхбузен Гренланди, аьхкенан хан", "MDT": "MDT", "TMT": "Туркменин стандартан хан", "HADT": "Гавайн-алеутийн аьхкенан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "AKDT": "Аляска, аьхкенан хан", "VET": "Венесуэла", "CHADT": "Чатем, аьхкенан хан", "AST": "Атлантикан стандартан хан", "BT": "Бутан", "MYT": "Малайзи", "HENOMX": "Къилбаседа Американ Мексикан аьхкенан хан", "GYT": "Гайана", "CDT": "Юккъера Америка, аьхкенан хан", "NZDT": "Керла Зеланди, аьхкенан хан", "IST": "Инди", "HEPM": "Сен-Пьер а, Микелон а, аьхкенан хан", "GMT": "Гринвичица юкъара хан", "GFT": "Французийн Гвиана", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "HNT": "Ньюфаундленд, стандартан хан", "HAT": "Ньюфаундленд, аьхкенан хан", "COT": "Колумби, стандартан хан", "WAT": "Малхбузен Африка, стандартан хан", "WEZ": "Малхбузен Европа, стандартан хан", "MESZ": "Юккъера Европа, аьхкенан хан", "HKT": "Гонконг, стандартан хан", "HKST": "Гонконг, аьхкенан хан", "EAT": "Малхбален Африка", "PDT": "Тийна океанан аьхкенан хан", "SGT": "Сингапур", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "MEZ": "Юккъера Европа, стандартан хан", "ACST": "Юккъера Австрали, стандартан хан", "LHDT": "Лорд-Хау, аьхкенан хан", "OEZ": "Малхбален Европа, стандартан хан", "HECU": "Куба, аьхкенан хан", "HEPMX": "Тийна океанан Мексикан аьхкенан хан", "WAST": "Малхбузен Африка, аьхкенан хан", "JST": "Япони, стандартан хан", "CLST": "Чили, аьхкенан хан", "ChST": "Чаморро", "NZST": "Керла Зеланди, стандартан хан", "AKST": "Аляска, стандартан хан", "HEEG": "Малхбален Гренланди, аьхкенан хан", "WITA": "Юккъера Индонези", "OESZ": "Малхбален Европа, аьхкенан хан", "ART": "Аргентина, стандартан хан", "COST": "Колумби, аьхкенан хан", "ACDT": "Юккъера Австрали, аьхкенан хан", "AEDT": "Малхбален Австрали, аьхкенан хан", "HNEG": "Малхбален Гренланди, стандартан хан", "LHST": "Лорд-Хау, стандартан хан", "CLT": "Чили, стандартан хан", "WIT": "Малхбален Индонези", "HAST": "Гавайн-алеутийн стандартан хан", "∅∅∅": "Амазонка, аьхкенан хан", "CST": "Юккъера Америка, стандартан хан", "HNCU": "Куба, стандартан хан", "HNPMX": "Тийна океанан Мексикан стандартан хан", "WIB": "Малхбузен Индонези", "EST": "Малхбален Америка, стандартан хан", "CHAST": "Чатем, стандартан хан", "BOT": "Боливи", "EDT": "Малхбален Америка, аьхкенан хан", "HNPM": "Сен-Пьер а, Микелон а, стандартан хан", "HNNOMX": "Къилбаседа Американ Мексикан стандартан хан", "MST": "MST", "ARST": "Аргентина, аьхкенан хан", "UYT": "Уругвай, стандартан хан", "HNOG": "Малхбузен Гренланди, стандартан хан", "WART": "Малхбузен Аргентина, стандартан хан", "ECT": "Эквадор", "SRT": "Суринам", "PST": "Тийна океанан стандартан хан", "ADT": "Атлантикан аьхкенан хан", "SAST": "Къилба Африка", "WESZ": "Малхбузен Европа, аьхкенан хан"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ce *ce) Locale() string {
+ return ce.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ce'
+func (ce *ce) PluralsCardinal() []locales.PluralRule {
+ return ce.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ce'
+func (ce *ce) PluralsOrdinal() []locales.PluralRule {
+ return ce.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ce'
+func (ce *ce) PluralsRange() []locales.PluralRule {
+ return ce.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ce'
+func (ce *ce) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ce'
+func (ce *ce) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ce'
+func (ce *ce) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ce *ce) MonthAbbreviated(month time.Month) string {
+ return ce.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ce *ce) MonthsAbbreviated() []string {
+ return ce.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ce *ce) MonthNarrow(month time.Month) string {
+ return ce.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ce *ce) MonthsNarrow() []string {
+ return ce.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ce *ce) MonthWide(month time.Month) string {
+ return ce.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ce *ce) MonthsWide() []string {
+ return ce.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ce *ce) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ce.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ce *ce) WeekdaysAbbreviated() []string {
+ return ce.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ce *ce) WeekdayNarrow(weekday time.Weekday) string {
+ return ce.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ce *ce) WeekdaysNarrow() []string {
+ return ce.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ce *ce) WeekdayShort(weekday time.Weekday) string {
+ return ce.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ce *ce) WeekdaysShort() []string {
+ return ce.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ce *ce) WeekdayWide(weekday time.Weekday) string {
+ return ce.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ce *ce) WeekdaysWide() []string {
+ return ce.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ce *ce) Decimal() string {
+ return ce.decimal
+}
+
+// Group returns the group of number
+func (ce *ce) Group() string {
+ return ce.group
+}
+
+// Group returns the minus sign of number
+func (ce *ce) Minus() string {
+ return ce.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ce' and handles both Whole and Real numbers based on 'v'
+func (ce *ce) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ce' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ce *ce) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ce.percentSuffix...)
+
+ b = append(b, ce.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ce'
+func (ce *ce) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ce.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ce.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ce.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ce'
+// in accounting notation.
+func (ce *ce) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ce.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ce.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ce.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ce.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ce.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ce'
+func (ce *ce) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ce'
+func (ce *ce) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ce'
+func (ce *ce) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ce'
+func (ce *ce) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ce'
+func (ce *ce) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ce'
+func (ce *ce) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ce'
+func (ce *ce) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ce'
+func (ce *ce) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ce/ce_test.go b/vendor/github.com/go-playground/locales/ce/ce_test.go
new file mode 100644
index 000000000..32181dcfb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ce/ce_test.go
@@ -0,0 +1,1120 @@
+package ce
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ce"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ce_RU/ce_RU.go b/vendor/github.com/go-playground/locales/ce_RU/ce_RU.go
new file mode 100644
index 000000000..051280a7e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ce_RU/ce_RU.go
@@ -0,0 +1,461 @@
+package ce_RU
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ce_RU struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ce_RU' locale
+func New() locales.Translator {
+ return &ce_RU{
+ locale: "ce_RU",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
+ monthsNarrow: []string{"", "Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"},
+ monthsWide: []string{"", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"},
+ daysAbbreviated: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysNarrow: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysShort: []string{"кӀи", "ор", "ши", "кха", "еа", "пӀе", "шуо"},
+ daysWide: []string{"кӀира", "оршот", "шинара", "кхаара", "еара", "пӀераска", "шуот"},
+ erasAbbreviated: []string{"в. э. тӀ. я", "в. э"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ӏийса пайхамар вина де кхачале", "Ӏийса пайхамар вина дийнахь дуьйна"},
+ timezones: map[string]string{"WAST": "Малхбузен Африка, аьхкенан хан", "BOT": "Боливи", "MESZ": "Юккъера Европа, аьхкенан хан", "EAT": "Малхбален Африка", "ChST": "Чаморро", "PST": "Тийна океанан стандартан хан", "AEST": "Малхбален Австрали, стандартан хан", "WEZ": "Малхбузен Европа, стандартан хан", "ECT": "Эквадор", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "HNEG": "Малхбален Гренланди, стандартан хан", "TMT": "Туркменин стандартан хан", "ART": "Аргентина, стандартан хан", "HECU": "Куба, аьхкенан хан", "WART": "Малхбузен Аргентина, стандартан хан", "COST": "Колумби, аьхкенан хан", "MDT": "Лаьмнийн аьхкенан хан (АЦШ)", "SAST": "Къилба Африка", "HKST": "Гонконг, аьхкенан хан", "HNPM": "Сен-Пьер а, Микелон а, стандартан хан", "WAT": "Малхбузен Африка, стандартан хан", "JST": "Япони, стандартан хан", "AKST": "Аляска, стандартан хан", "ACDT": "Юккъера Австрали, аьхкенан хан", "IST": "Инди", "AST": "Атлантикан стандартан хан", "ADT": "Атлантикан аьхкенан хан", "NZST": "Керла Зеланди, стандартан хан", "MYT": "Малайзи", "HAT": "Ньюфаундленд, аьхкенан хан", "VET": "Венесуэла", "COT": "Колумби, стандартан хан", "MST": "Лаьмнийн стандартан хан (АЦШ)", "BT": "Бутан", "∅∅∅": "Амазонка, аьхкенан хан", "EDT": "Малхбален Америка, аьхкенан хан", "HNCU": "Куба, стандартан хан", "CDT": "Юккъера Америка, аьхкенан хан", "AKDT": "Аляска, аьхкенан хан", "ACST": "Юккъера Австрали, стандартан хан", "HEPM": "Сен-Пьер а, Микелон а, аьхкенан хан", "CLT": "Чили, стандартан хан", "HAST": "Гавайн-алеутийн стандартан хан", "CHADT": "Чатем, аьхкенан хан", "GFT": "Французийн Гвиана", "SGT": "Сингапур", "HEEG": "Малхбален Гренланди, аьхкенан хан", "HEOG": "Малхбузен Гренланди, аьхкенан хан", "MEZ": "Юккъера Европа, стандартан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "WESZ": "Малхбузен Европа, аьхкенан хан", "WIB": "Малхбузен Индонези", "HNNOMX": "Къилбаседа Американ Мексикан стандартан хан", "EST": "Малхбален Америка, стандартан хан", "HENOMX": "Къилбаседа Американ Мексикан аьхкенан хан", "SRT": "Суринам", "GMT": "Гринвичица юкъара хан", "CST": "Юккъера Америка, стандартан хан", "PDT": "Тийна океанан аьхкенан хан", "HNPMX": "Тийна океанан Мексикан стандартан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "HADT": "Гавайн-алеутийн аьхкенан хан", "ARST": "Аргентина, аьхкенан хан", "CHAST": "Чатем, стандартан хан", "HNOG": "Малхбузен Гренланди, стандартан хан", "HKT": "Гонконг, стандартан хан", "WITA": "Юккъера Индонези", "GYT": "Гайана", "UYST": "Уругвай, аьхкенан хан", "HEPMX": "Тийна океанан Мексикан аьхкенан хан", "AWST": "Малхбузен Австрали, стандартан хан", "AEDT": "Малхбален Австрали, аьхкенан хан", "NZDT": "Керла Зеланди, аьхкенан хан", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "CLST": "Чили, аьхкенан хан", "WIT": "Малхбален Индонези", "UYT": "Уругвай, стандартан хан", "HNT": "Ньюфаундленд, стандартан хан", "TMST": "Туркменин аьхкенан хан", "OEZ": "Малхбален Европа, стандартан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "LHDT": "Лорд-Хау, аьхкенан хан", "CAT": "Юккъера Африка", "JDT": "Япони, аьхкенан хан", "LHST": "Лорд-Хау, стандартан хан"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ce *ce_RU) Locale() string {
+ return ce.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ce_RU'
+func (ce *ce_RU) PluralsCardinal() []locales.PluralRule {
+ return ce.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ce_RU'
+func (ce *ce_RU) PluralsOrdinal() []locales.PluralRule {
+ return ce.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ce_RU'
+func (ce *ce_RU) PluralsRange() []locales.PluralRule {
+ return ce.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ce_RU'
+func (ce *ce_RU) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ce_RU'
+func (ce *ce_RU) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ce_RU'
+func (ce *ce_RU) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ce *ce_RU) MonthAbbreviated(month time.Month) string {
+ return ce.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ce *ce_RU) MonthsAbbreviated() []string {
+ return ce.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ce *ce_RU) MonthNarrow(month time.Month) string {
+ return ce.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ce *ce_RU) MonthsNarrow() []string {
+ return ce.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ce *ce_RU) MonthWide(month time.Month) string {
+ return ce.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ce *ce_RU) MonthsWide() []string {
+ return ce.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ce *ce_RU) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ce.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ce *ce_RU) WeekdaysAbbreviated() []string {
+ return ce.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ce *ce_RU) WeekdayNarrow(weekday time.Weekday) string {
+ return ce.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ce *ce_RU) WeekdaysNarrow() []string {
+ return ce.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ce *ce_RU) WeekdayShort(weekday time.Weekday) string {
+ return ce.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ce *ce_RU) WeekdaysShort() []string {
+ return ce.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ce *ce_RU) WeekdayWide(weekday time.Weekday) string {
+ return ce.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ce *ce_RU) WeekdaysWide() []string {
+ return ce.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ce *ce_RU) Decimal() string {
+ return ce.decimal
+}
+
+// Group returns the group of number
+func (ce *ce_RU) Group() string {
+ return ce.group
+}
+
+// Group returns the minus sign of number
+func (ce *ce_RU) Minus() string {
+ return ce.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ce_RU' and handles both Whole and Real numbers based on 'v'
+func (ce *ce_RU) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ce_RU' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ce *ce_RU) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ce.percentSuffix...)
+
+ b = append(b, ce.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ce_RU'
+func (ce *ce_RU) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ce.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ce.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ce.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ce.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ce_RU'
+// in accounting notation.
+func (ce *ce_RU) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ce.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ce.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ce.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, ce.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ce.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ce.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ce.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ce_RU'
+func (ce *ce_RU) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ce_RU/ce_RU_test.go b/vendor/github.com/go-playground/locales/ce_RU/ce_RU_test.go
new file mode 100644
index 000000000..281f8d24a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ce_RU/ce_RU_test.go
@@ -0,0 +1,1120 @@
+package ce_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ce_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cgg/cgg.go b/vendor/github.com/go-playground/locales/cgg/cgg.go
new file mode 100644
index 000000000..bf303e534
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cgg/cgg.go
@@ -0,0 +1,530 @@
+package cgg
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cgg struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cgg' locale
+func New() locales.Translator {
+ return &cgg{
+ locale: "cgg",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "USh", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "KBZ", "KBR", "KST", "KKN", "KTN", "KMK", "KMS", "KMN", "KMW", "KKM", "KNK", "KNB"},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Okwokubanza", "Okwakabiri", "Okwakashatu", "Okwakana", "Okwakataana", "Okwamukaaga", "Okwamushanju", "Okwamunaana", "Okwamwenda", "Okwaikumi", "Okwaikumi na kumwe", "Okwaikumi na ibiri"},
+ daysAbbreviated: []string{"SAN", "ORK", "OKB", "OKS", "OKN", "OKT", "OMK"},
+ daysNarrow: []string{"S", "K", "R", "S", "N", "T", "M"},
+ daysWide: []string{"Sande", "Orwokubanza", "Orwakabiri", "Orwakashatu", "Orwakana", "Orwakataano", "Orwamukaaga"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
+ timezones: map[string]string{"EST": "EST", "TMT": "TMT", "ADT": "ADT", "ECT": "ECT", "JDT": "JDT", "MEZ": "MEZ", "MST": "MST", "TMST": "TMST", "GMT": "GMT", "UYT": "UYT", "WEZ": "WEZ", "JST": "JST", "WIT": "WIT", "COST": "COST", "AST": "AST", "NZDT": "NZDT", "ACWDT": "ACWDT", "HEOG": "HEOG", "BOT": "BOT", "AKDT": "AKDT", "CLST": "CLST", "HAST": "HAST", "CST": "CST", "HEPMX": "HEPMX", "AEST": "AEST", "WAT": "WAT", "NZST": "NZST", "MDT": "MDT", "SRT": "SRT", "CLT": "CLT", "OESZ": "OESZ", "∅∅∅": "∅∅∅", "PDT": "PDT", "LHDT": "LHDT", "HEPM": "HEPM", "CAT": "CAT", "HECU": "HECU", "AWDT": "AWDT", "HNPMX": "HNPMX", "AEDT": "AEDT", "MESZ": "MESZ", "OEZ": "OEZ", "COT": "COT", "CHAST": "CHAST", "SGT": "SGT", "HNCU": "HNCU", "CDT": "CDT", "MYT": "MYT", "EDT": "EDT", "HEEG": "HEEG", "HNPM": "HNPM", "HNNOMX": "HNNOMX", "PST": "PST", "GFT": "GFT", "ACDT": "ACDT", "HKT": "HKT", "WART": "WART", "WITA": "WITA", "EAT": "EAT", "HADT": "HADT", "ARST": "ARST", "CHADT": "CHADT", "AKST": "AKST", "ART": "ART", "SAST": "SAST", "WAST": "WAST", "ACWST": "ACWST", "VET": "VET", "BT": "BT", "IST": "IST", "AWST": "AWST", "HNOG": "HNOG", "LHST": "LHST", "HAT": "HAT", "HENOMX": "HENOMX", "GYT": "GYT", "UYST": "UYST", "ChST": "ChST", "WIB": "WIB", "HKST": "HKST", "WARST": "WARST", "WESZ": "WESZ", "ACST": "ACST", "HNEG": "HNEG", "HNT": "HNT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cgg *cgg) Locale() string {
+ return cgg.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cgg'
+func (cgg *cgg) PluralsCardinal() []locales.PluralRule {
+ return cgg.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cgg'
+func (cgg *cgg) PluralsOrdinal() []locales.PluralRule {
+ return cgg.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cgg'
+func (cgg *cgg) PluralsRange() []locales.PluralRule {
+ return cgg.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cgg'
+func (cgg *cgg) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cgg'
+func (cgg *cgg) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cgg'
+func (cgg *cgg) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cgg *cgg) MonthAbbreviated(month time.Month) string {
+ return cgg.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cgg *cgg) MonthsAbbreviated() []string {
+ return cgg.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cgg *cgg) MonthNarrow(month time.Month) string {
+ return cgg.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cgg *cgg) MonthsNarrow() []string {
+ return cgg.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cgg *cgg) MonthWide(month time.Month) string {
+ return cgg.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cgg *cgg) MonthsWide() []string {
+ return cgg.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cgg *cgg) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cgg.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cgg *cgg) WeekdaysAbbreviated() []string {
+ return cgg.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cgg *cgg) WeekdayNarrow(weekday time.Weekday) string {
+ return cgg.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cgg *cgg) WeekdaysNarrow() []string {
+ return cgg.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cgg *cgg) WeekdayShort(weekday time.Weekday) string {
+ return cgg.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cgg *cgg) WeekdaysShort() []string {
+ return cgg.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cgg *cgg) WeekdayWide(weekday time.Weekday) string {
+ return cgg.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cgg *cgg) WeekdaysWide() []string {
+ return cgg.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cgg *cgg) Decimal() string {
+ return cgg.decimal
+}
+
+// Group returns the group of number
+func (cgg *cgg) Group() string {
+ return cgg.group
+}
+
+// Group returns the minus sign of number
+func (cgg *cgg) Minus() string {
+ return cgg.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cgg' and handles both Whole and Real numbers based on 'v'
+func (cgg *cgg) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cgg' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cgg *cgg) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cgg'
+func (cgg *cgg) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cgg.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cgg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cgg.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, cgg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cgg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cgg'
+// in accounting notation.
+func (cgg *cgg) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cgg.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cgg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cgg.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, cgg.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cgg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cgg'
+func (cgg *cgg) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cgg'
+func (cgg *cgg) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cgg'
+func (cgg *cgg) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cgg'
+func (cgg *cgg) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cgg.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cgg'
+func (cgg *cgg) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cgg'
+func (cgg *cgg) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cgg'
+func (cgg *cgg) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cgg'
+func (cgg *cgg) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cgg.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cgg/cgg_test.go b/vendor/github.com/go-playground/locales/cgg/cgg_test.go
new file mode 100644
index 000000000..3fae92e9f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cgg/cgg_test.go
@@ -0,0 +1,1120 @@
+package cgg
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cgg"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG.go b/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG.go
new file mode 100644
index 000000000..3e3ea173d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG.go
@@ -0,0 +1,530 @@
+package cgg_UG
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cgg_UG struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cgg_UG' locale
+func New() locales.Translator {
+ return &cgg_UG{
+ locale: "cgg_UG",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "KBZ", "KBR", "KST", "KKN", "KTN", "KMK", "KMS", "KMN", "KMW", "KKM", "KNK", "KNB"},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Okwokubanza", "Okwakabiri", "Okwakashatu", "Okwakana", "Okwakataana", "Okwamukaaga", "Okwamushanju", "Okwamunaana", "Okwamwenda", "Okwaikumi", "Okwaikumi na kumwe", "Okwaikumi na ibiri"},
+ daysAbbreviated: []string{"SAN", "ORK", "OKB", "OKS", "OKN", "OKT", "OMK"},
+ daysNarrow: []string{"S", "K", "R", "S", "N", "T", "M"},
+ daysWide: []string{"Sande", "Orwokubanza", "Orwakabiri", "Orwakashatu", "Orwakana", "Orwakataano", "Orwamukaaga"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
+ timezones: map[string]string{"LHDT": "LHDT", "PST": "PST", "HKST": "HKST", "CAT": "CAT", "TMST": "TMST", "JDT": "JDT", "MDT": "MDT", "ACST": "ACST", "VET": "VET", "ART": "ART", "ARST": "ARST", "AKDT": "AKDT", "ACWDT": "ACWDT", "WIT": "WIT", "HADT": "HADT", "CST": "CST", "SAST": "SAST", "BOT": "BOT", "SGT": "SGT", "EAT": "EAT", "TMT": "TMT", "OEZ": "OEZ", "GMT": "GMT", "CHADT": "CHADT", "HNPMX": "HNPMX", "AST": "AST", "ECT": "ECT", "BT": "BT", "NZDT": "NZDT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "WITA": "WITA", "CLST": "CLST", "GYT": "GYT", "HNCU": "HNCU", "WESZ": "WESZ", "MEZ": "MEZ", "IST": "IST", "LHST": "LHST", "OESZ": "OESZ", "AEST": "AEST", "WAST": "WAST", "MESZ": "MESZ", "HEPM": "HEPM", "HNNOMX": "HNNOMX", "SRT": "SRT", "UYT": "UYT", "EDT": "EDT", "PDT": "PDT", "HEPMX": "HEPMX", "UYST": "UYST", "HNPM": "HNPM", "CHAST": "CHAST", "MYT": "MYT", "GFT": "GFT", "EST": "EST", "CLT": "CLT", "COST": "COST", "HECU": "HECU", "AWST": "AWST", "AWDT": "AWDT", "ADT": "ADT", "HEEG": "HEEG", "HKT": "HKT", "COT": "COT", "AKST": "AKST", "ACWST": "ACWST", "HNEG": "HNEG", "HEOG": "HEOG", "WARST": "WARST", "HAT": "HAT", "MST": "MST", "HAST": "HAST", "ACDT": "ACDT", "WAT": "WAT", "WEZ": "WEZ", "CDT": "CDT", "HNT": "HNT", "HENOMX": "HENOMX", "WART": "WART", "JST": "JST", "ChST": "ChST", "WIB": "WIB", "NZST": "NZST", "HNOG": "HNOG"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cgg *cgg_UG) Locale() string {
+ return cgg.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cgg_UG'
+func (cgg *cgg_UG) PluralsCardinal() []locales.PluralRule {
+ return cgg.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cgg_UG'
+func (cgg *cgg_UG) PluralsOrdinal() []locales.PluralRule {
+ return cgg.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cgg_UG'
+func (cgg *cgg_UG) PluralsRange() []locales.PluralRule {
+ return cgg.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cgg_UG'
+func (cgg *cgg_UG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cgg_UG'
+func (cgg *cgg_UG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cgg_UG'
+func (cgg *cgg_UG) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cgg *cgg_UG) MonthAbbreviated(month time.Month) string {
+ return cgg.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cgg *cgg_UG) MonthsAbbreviated() []string {
+ return cgg.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cgg *cgg_UG) MonthNarrow(month time.Month) string {
+ return cgg.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cgg *cgg_UG) MonthsNarrow() []string {
+ return cgg.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cgg *cgg_UG) MonthWide(month time.Month) string {
+ return cgg.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cgg *cgg_UG) MonthsWide() []string {
+ return cgg.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cgg *cgg_UG) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cgg.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cgg *cgg_UG) WeekdaysAbbreviated() []string {
+ return cgg.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cgg *cgg_UG) WeekdayNarrow(weekday time.Weekday) string {
+ return cgg.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cgg *cgg_UG) WeekdaysNarrow() []string {
+ return cgg.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cgg *cgg_UG) WeekdayShort(weekday time.Weekday) string {
+ return cgg.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cgg *cgg_UG) WeekdaysShort() []string {
+ return cgg.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cgg *cgg_UG) WeekdayWide(weekday time.Weekday) string {
+ return cgg.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cgg *cgg_UG) WeekdaysWide() []string {
+ return cgg.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cgg *cgg_UG) Decimal() string {
+ return cgg.decimal
+}
+
+// Group returns the group of number
+func (cgg *cgg_UG) Group() string {
+ return cgg.group
+}
+
+// Group returns the minus sign of number
+func (cgg *cgg_UG) Minus() string {
+ return cgg.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cgg_UG' and handles both Whole and Real numbers based on 'v'
+func (cgg *cgg_UG) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cgg_UG' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cgg *cgg_UG) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cgg_UG'
+func (cgg *cgg_UG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cgg.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cgg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cgg.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, cgg.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cgg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cgg_UG'
+// in accounting notation.
+func (cgg *cgg_UG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cgg.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cgg.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cgg.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, cgg.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cgg.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cgg.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cgg.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cgg_UG'
+func (cgg *cgg_UG) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cgg.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cgg.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG_test.go b/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG_test.go
new file mode 100644
index 000000000..6620db686
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cgg_UG/cgg_UG_test.go
@@ -0,0 +1,1120 @@
+package cgg_UG
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cgg_UG"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/chr/chr.go b/vendor/github.com/go-playground/locales/chr/chr.go
new file mode 100644
index 000000000..f285ec212
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/chr/chr.go
@@ -0,0 +1,636 @@
+package chr
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type chr struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'chr' locale
+func New() locales.Translator {
+ return &chr{
+ locale: "chr",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "ᎤᏃ", "ᎧᎦ", "ᎠᏅ", "ᎧᏬ", "ᎠᏂ", "ᏕᎭ", "ᎫᏰ", "ᎦᎶ", "ᏚᎵ", "ᏚᏂ", "ᏅᏓ", "ᎥᏍ"},
+ monthsNarrow: []string{"", "Ꭴ", "Ꭷ", "Ꭰ", "Ꭷ", "Ꭰ", "Ꮥ", "Ꭻ", "Ꭶ", "Ꮪ", "Ꮪ", "Ꮕ", "Ꭵ"},
+ monthsWide: []string{"", "ᎤᏃᎸᏔᏅ", "ᎧᎦᎵ", "ᎠᏅᏱ", "ᎧᏬᏂ", "ᎠᏂᏍᎬᏘ", "ᏕᎭᎷᏱ", "ᎫᏰᏉᏂ", "ᎦᎶᏂ", "ᏚᎵᏍᏗ", "ᏚᏂᏅᏗ", "ᏅᏓᏕᏆ", "ᎥᏍᎩᏱ"},
+ daysAbbreviated: []string{"ᏆᏍᎬ", "ᏉᏅᎯ", "ᏔᎵᏁ", "ᏦᎢᏁ", "ᏅᎩᏁ", "ᏧᎾᎩ", "ᏈᏕᎾ"},
+ daysNarrow: []string{"Ꮖ", "Ꮙ", "Ꮤ", "Ꮶ", "Ꮕ", "Ꮷ", "Ꭴ"},
+ daysShort: []string{"ᏍᎬ", "ᏅᎯ", "ᏔᎵ", "ᏦᎢ", "ᏅᎩ", "ᏧᎾ", "ᏕᎾ"},
+ daysWide: []string{"ᎤᎾᏙᏓᏆᏍᎬ", "ᎤᎾᏙᏓᏉᏅᎯ", "ᏔᎵᏁᎢᎦ", "ᏦᎢᏁᎢᎦ", "ᏅᎩᏁᎢᎦ", "ᏧᎾᎩᎶᏍᏗ", "ᎤᎾᏙᏓᏈᏕᎾ"},
+ periodsAbbreviated: []string{"ᏌᎾᎴ", "ᏒᎯᏱᎢᏗᏢ"},
+ periodsNarrow: []string{"Ꮜ", "Ꮢ"},
+ periodsWide: []string{"ᏌᎾᎴ", "ᏒᎯᏱᎢᏗᏢ"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"ᏧᏓᎷᎸ ᎤᎷᎯᏍᏗ ᎦᎶᏁᏛ", "ᎠᏃ ᏙᎻᏂ"},
+ timezones: map[string]string{"WAST": "ᏭᏕᎵᎬ ᎬᎿᎨᏍᏛ ᎪᎩ ᎠᏟᎢᎵᏒ", "NZST": "ᎢᏤ ᏏᎢᎴᏂᏗ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "JST": "ᏣᏩᏂᏏ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HNT": "ᎢᏤᎤᏂᏩᏛᏓᎦᏙᎯ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "BT": "ᏊᏔᏂ ᎠᏟᎢᎵᏒ", "IST": "ᎢᏂᏗᎢᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "LHDT": "ᎤᎬᏫᏳᎯ ᎭᏫ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "AWST": "ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "MYT": "ᎹᎴᏏᎢᎠ ᎠᏟᎢᎵᏒ", "HKST": "ᎰᏂᎩ ᎪᏂᎩ ᎪᎩ ᎠᏟᎢᎵᏒ", "LHST": "ᎤᎬᏫᏳᎯ ᎭᏫ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "UYST": "ᏳᎷᏇ ᎪᎩ ᎠᏟᎢᎵᏒ", "AST": "ᏗᎧᎸᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "AKDT": "ᎠᎳᏍᎦ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "MESZ": "ᎠᏰᏟ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "EAT": "ᏗᎧᎸᎬ ᎬᎿᎨᏍᏛ ᎠᏟᎢᎵᏒ", "TMT": "ᏛᎵᎩᎺᏂᏍᏔᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HNPM": "ᎤᏓᏅᏘ ᏈᏰ ᎠᎴ ᎻᏇᎶᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ADT": "ᏗᎧᎸᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "AEST": "ᎡᎳᏗᏜ ᏗᎧᎸᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "NZDT": "ᎢᏤ ᏏᎢᎴᏂᏗ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "ECT": "ᎡᏆᏙᎵ ᎠᏟᎢᎵᏒ", "EDT": "ᏗᎧᎸᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "ACWST": "ᎠᏰᏟ ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ACWDT": "ᎠᏰᏟ ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "CAT": "ᎠᏰᏟ ᎬᎿᎨᏍᏛ ᎠᏟᎢᎵᏒ", "HAST": "ᎭᏩᏱ-ᎠᎵᏳᏏᎠᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ARST": "ᎠᏥᏂᏘᏂᎠ ᎪᎩ ᎠᏟᎢᎵᏒ", "CST": "ᎠᏰᏟ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "AWDT": "ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HKT": "ᎰᏂᎩ ᎪᏂᎩ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "OESZ": "ᏗᎧᎸᎬ ᏗᏜ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎠᏟᎢᎵᏒ", "CHADT": "ᏣᏝᎻ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HNPMX": "ᎠᏂᏍᏆᏂ ᏭᏕᎵᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "EST": "ᏗᎧᎸᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ACDT": "ᎠᏰᏟ ᎡᎳᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "MEZ": "ᎠᏰᏟ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WART": "ᏭᏕᎵᎬ ᏗᏜ ᎠᏥᏂᏘᏂᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "MST": "ᎣᏓᎸ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WAT": "ᏭᏕᎵᎬ ᎬᎿᎨᏍᏛ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WIB": "ᏭᏕᎵᎬ ᏗᏜ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "GFT": "ᎠᏂᎦᎸ ᏈᏯᎾ ᎠᏟᎢᎵᏒ", "HNNOMX": "ᏧᏴᏢ ᏭᏕᎵᎬ ᎠᏂᏍᏆᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CLT": "ᏥᎵ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "COST": "ᎪᎸᎻᏈᎢᎠ ᎪᎩ ᎠᏟᎢᎵᏒ", "SAST": "ᏧᎦᎾᏮ ᎬᎿᎨᏍᏛ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "BOT": "ᏉᎵᏫᎠ ᎠᏟᎢᎵᏒ", "HEOG": "ᏭᏕᎵᎬ ᎢᏤᏍᏛᏱ ᎪᎩ ᎠᏟᎢᎵᏒ", "UYT": "ᏳᎷᏇ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WIT": "ᏗᎧᎸᎬ ᏗᏜ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "PDT": "ᏭᏕᎵᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "SGT": "ᏏᏂᎦᏉᎵ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ART": "ᎠᏥᏂᏘᏂᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ChST": "ᏣᎼᎶ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HEEG": "ᏗᎧᎸᎬ ᎢᏤᏍᏛᏱ ᎪᎩ ᎠᏟᎢᎵᏒ", "WARST": "ᏭᏕᎵᎬ ᏗᏜ ᎠᏥᏂᏘᏂᎠ ᎪᎩ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "VET": "ᏪᏁᏑᏪᎳ ᎠᏟᎢᎵᏒ", "HENOMX": "ᏧᏴᏢ ᏭᏕᎵᎬ ᎠᏂᏍᏆᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "GYT": "ᎦᏯᎾ ᎠᏟᎢᎵᏒ", "ACST": "ᎠᏰᏟ ᎡᎳᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CDT": "ᎠᏰᏟ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "WESZ": "ᏭᏕᎵᎬ ᏗᏜ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "∅∅∅": "∅∅∅", "AKST": "ᎠᎳᏍᎦ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HNEG": "ᏗᎧᎸᎬ ᎢᏤᏍᏛᏱ ᎠᏟᎶᏍᏗ ᎠᎵᎢᎵᏒ", "SRT": "ᏒᎵᎾᎻ ᎠᏟᎢᎵᏒ", "CLST": "ᏥᎵ ᎪᎩ ᎠᏟᎢᎵᏒ", "HECU": "ᎫᏆ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "PST": "ᏭᏕᎵᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HEPMX": "ᎠᏂᏍᏆᏂ ᏭᏕᎵᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "MDT": "ᎣᏓᎸ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "HAT": "ᎢᏤᎤᏂᏩᏛᏓᎦᏙᎯ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "HEPM": "ᎤᏓᏅᏘ ᏈᏰ ᎠᎴ ᎻᏇᎶᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "WITA": "ᎠᏰᏟ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "TMST": "ᏛᎵᎩᎺᏂᏍᏔᏂ ᎪᎩ ᎠᏟᎢᎵᏒ", "OEZ": "ᏗᎧᎸᎬ ᏗᏜ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HADT": "ᎭᏩᏱ-ᎠᎵᏳᏏᎠᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "AEDT": "ᎡᎳᏗᏜ ᏗᎧᎸᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "WEZ": "ᏭᏕᎵᎬ ᏗᏜ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "JDT": "ᏣᏩᏂᏏ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HNOG": "ᏭᏕᎵᎬ ᎢᏤᏍᏛᏱ ᎠᏟᎶᏍᏗ ᎠᎵᎢᎵᏒ", "COT": "ᎪᎸᎻᏈᎢᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CHAST": "ᏣᏝᎻ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HNCU": "ᎫᏆ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (chr *chr) Locale() string {
+ return chr.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'chr'
+func (chr *chr) PluralsCardinal() []locales.PluralRule {
+ return chr.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'chr'
+func (chr *chr) PluralsOrdinal() []locales.PluralRule {
+ return chr.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'chr'
+func (chr *chr) PluralsRange() []locales.PluralRule {
+ return chr.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'chr'
+func (chr *chr) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'chr'
+func (chr *chr) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'chr'
+func (chr *chr) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (chr *chr) MonthAbbreviated(month time.Month) string {
+ return chr.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (chr *chr) MonthsAbbreviated() []string {
+ return chr.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (chr *chr) MonthNarrow(month time.Month) string {
+ return chr.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (chr *chr) MonthsNarrow() []string {
+ return chr.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (chr *chr) MonthWide(month time.Month) string {
+ return chr.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (chr *chr) MonthsWide() []string {
+ return chr.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (chr *chr) WeekdayAbbreviated(weekday time.Weekday) string {
+ return chr.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (chr *chr) WeekdaysAbbreviated() []string {
+ return chr.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (chr *chr) WeekdayNarrow(weekday time.Weekday) string {
+ return chr.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (chr *chr) WeekdaysNarrow() []string {
+ return chr.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (chr *chr) WeekdayShort(weekday time.Weekday) string {
+ return chr.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (chr *chr) WeekdaysShort() []string {
+ return chr.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (chr *chr) WeekdayWide(weekday time.Weekday) string {
+ return chr.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (chr *chr) WeekdaysWide() []string {
+ return chr.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (chr *chr) Decimal() string {
+ return chr.decimal
+}
+
+// Group returns the group of number
+func (chr *chr) Group() string {
+ return chr.group
+}
+
+// Group returns the minus sign of number
+func (chr *chr) Minus() string {
+ return chr.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'chr' and handles both Whole and Real numbers based on 'v'
+func (chr *chr) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'chr' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (chr *chr) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, chr.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'chr'
+func (chr *chr) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := chr.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, chr.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'chr'
+// in accounting notation.
+func (chr *chr) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := chr.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, chr.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, chr.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, chr.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'chr'
+func (chr *chr) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'chr'
+func (chr *chr) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'chr'
+func (chr *chr) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'chr'
+func (chr *chr) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, chr.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'chr'
+func (chr *chr) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'chr'
+func (chr *chr) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'chr'
+func (chr *chr) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'chr'
+func (chr *chr) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := chr.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/chr/chr_test.go b/vendor/github.com/go-playground/locales/chr/chr_test.go
new file mode 100644
index 000000000..4c960a42a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/chr/chr_test.go
@@ -0,0 +1,1120 @@
+package chr
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "chr"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/chr_US/chr_US.go b/vendor/github.com/go-playground/locales/chr_US/chr_US.go
new file mode 100644
index 000000000..3c999985d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/chr_US/chr_US.go
@@ -0,0 +1,636 @@
+package chr_US
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type chr_US struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'chr_US' locale
+func New() locales.Translator {
+ return &chr_US{
+ locale: "chr_US",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "ᎤᏃ", "ᎧᎦ", "ᎠᏅ", "ᎧᏬ", "ᎠᏂ", "ᏕᎭ", "ᎫᏰ", "ᎦᎶ", "ᏚᎵ", "ᏚᏂ", "ᏅᏓ", "ᎥᏍ"},
+ monthsNarrow: []string{"", "Ꭴ", "Ꭷ", "Ꭰ", "Ꭷ", "Ꭰ", "Ꮥ", "Ꭻ", "Ꭶ", "Ꮪ", "Ꮪ", "Ꮕ", "Ꭵ"},
+ monthsWide: []string{"", "ᎤᏃᎸᏔᏅ", "ᎧᎦᎵ", "ᎠᏅᏱ", "ᎧᏬᏂ", "ᎠᏂᏍᎬᏘ", "ᏕᎭᎷᏱ", "ᎫᏰᏉᏂ", "ᎦᎶᏂ", "ᏚᎵᏍᏗ", "ᏚᏂᏅᏗ", "ᏅᏓᏕᏆ", "ᎥᏍᎩᏱ"},
+ daysAbbreviated: []string{"ᏆᏍᎬ", "ᏉᏅᎯ", "ᏔᎵᏁ", "ᏦᎢᏁ", "ᏅᎩᏁ", "ᏧᎾᎩ", "ᏈᏕᎾ"},
+ daysNarrow: []string{"Ꮖ", "Ꮙ", "Ꮤ", "Ꮶ", "Ꮕ", "Ꮷ", "Ꭴ"},
+ daysShort: []string{"ᏍᎬ", "ᏅᎯ", "ᏔᎵ", "ᏦᎢ", "ᏅᎩ", "ᏧᎾ", "ᏕᎾ"},
+ daysWide: []string{"ᎤᎾᏙᏓᏆᏍᎬ", "ᎤᎾᏙᏓᏉᏅᎯ", "ᏔᎵᏁᎢᎦ", "ᏦᎢᏁᎢᎦ", "ᏅᎩᏁᎢᎦ", "ᏧᎾᎩᎶᏍᏗ", "ᎤᎾᏙᏓᏈᏕᎾ"},
+ periodsAbbreviated: []string{"ᏌᎾᎴ", "ᏒᎯᏱᎢᏗᏢ"},
+ periodsNarrow: []string{"Ꮜ", "Ꮢ"},
+ periodsWide: []string{"ᏌᎾᎴ", "ᏒᎯᏱᎢᏗᏢ"},
+ erasAbbreviated: []string{"BC", "AD"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"ᏧᏓᎷᎸ ᎤᎷᎯᏍᏗ ᎦᎶᏁᏛ", "ᎠᏃ ᏙᎻᏂ"},
+ timezones: map[string]string{"OEZ": "ᏗᎧᎸᎬ ᏗᏜ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CDT": "ᎠᏰᏟ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "HNOG": "ᏭᏕᎵᎬ ᎢᏤᏍᏛᏱ ᎠᏟᎶᏍᏗ ᎠᎵᎢᎵᏒ", "MDT": "MDT", "TMST": "ᏛᎵᎩᎺᏂᏍᏔᏂ ᎪᎩ ᎠᏟᎢᎵᏒ", "ACWDT": "ᎠᏰᏟ ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "WART": "ᏭᏕᎵᎬ ᏗᏜ ᎠᏥᏂᏘᏂᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "OESZ": "ᏗᎧᎸᎬ ᏗᏜ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "AST": "ᏗᎧᎸᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "SAST": "ᏧᎦᎾᏮ ᎬᎿᎨᏍᏛ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "VET": "ᏪᏁᏑᏪᎳ ᎠᏟᎢᎵᏒ", "HNPM": "ᎤᏓᏅᏘ ᏈᏰ ᎠᎴ ᎻᏇᎶᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "TMT": "ᏛᎵᎩᎺᏂᏍᏔᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "PST": "ᏭᏕᎵᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "NZST": "ᎢᏤ ᏏᎢᎴᏂᏗ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "EDT": "ᏗᎧᎸᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "MESZ": "ᎠᏰᏟ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "HEOG": "ᏭᏕᎵᎬ ᎢᏤᏍᏛᏱ ᎪᎩ ᎠᏟᎢᎵᏒ", "HAT": "ᎢᏤᎤᏂᏩᏛᏓᎦᏙᎯ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "SRT": "ᏒᎵᎾᎻ ᎠᏟᎢᎵᏒ", "WIT": "ᏗᎧᎸᎬ ᏗᏜ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "GFT": "ᎠᏂᎦᎸ ᏈᏯᎾ ᎠᏟᎢᎵᏒ", "JDT": "ᏣᏩᏂᏏ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "AKST": "ᎠᎳᏍᎦ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "AEST": "ᎡᎳᏗᏜ ᏗᎧᎸᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ADT": "ᏗᎧᎸᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "WESZ": "ᏭᏕᎵᎬ ᏗᏜ ᏳᎳᏈ ᎪᎩ ᎠᏟᎢᎵᏒ", "HNEG": "ᏗᎧᎸᎬ ᎢᏤᏍᏛᏱ ᎠᏟᎶᏍᏗ ᎠᎵᎢᎵᏒ", "EAT": "ᏗᎧᎸᎬ ᎬᎿᎨᏍᏛ ᎠᏟᎢᎵᏒ", "HNCU": "ᎫᏆ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CHAST": "ᏣᏝᎻ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "JST": "ᏣᏩᏂᏏ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HAST": "ᎭᏩᏱ-ᎠᎵᏳᏏᎠᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ART": "ᎠᏥᏂᏘᏂᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HNNOMX": "ᏧᏴᏢ ᏭᏕᎵᎬ ᎠᏂᏍᏆᏂ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "MST": "MST", "PDT": "ᏭᏕᎵᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "AWST": "ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WIB": "ᏭᏕᎵᎬ ᏗᏜ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "HEEG": "ᏗᎧᎸᎬ ᎢᏤᏍᏛᏱ ᎪᎩ ᎠᏟᎢᎵᏒ", "LHST": "ᎤᎬᏫᏳᎯ ᎭᏫ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HEPM": "ᎤᏓᏅᏘ ᏈᏰ ᎠᎴ ᎻᏇᎶᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "WEZ": "ᏭᏕᎵᎬ ᏗᏜ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "IST": "ᎢᏂᏗᎢᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CHADT": "ᏣᏝᎻ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HNPMX": "ᎠᏂᏍᏆᏂ ᏭᏕᎵᎬ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ChST": "ᏣᎼᎶ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HEPMX": "ᎠᏂᏍᏆᏂ ᏭᏕᎵᎬ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "WAST": "ᏭᏕᎵᎬ ᎬᎿᎨᏍᏛ ᎪᎩ ᎠᏟᎢᎵᏒ", "CAT": "ᎠᏰᏟ ᎬᎿᎨᏍᏛ ᎠᏟᎢᎵᏒ", "HADT": "ᎭᏩᏱ-ᎠᎵᏳᏏᎠᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "ARST": "ᎠᏥᏂᏘᏂᎠ ᎪᎩ ᎠᏟᎢᎵᏒ", "WITA": "ᎠᏰᏟ ᎢᏂᏙᏂᏍᏯ ᎠᏟᎢᎵᏒ", "CLT": "ᏥᎵ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "CLST": "ᏥᎵ ᎪᎩ ᎠᏟᎢᎵᏒ", "HECU": "ᎫᏆ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "AWDT": "ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "SGT": "ᏏᏂᎦᏉᎵ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ACWST": "ᎠᏰᏟ ᎡᎳᏗᏜ ᏭᏕᎵᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WARST": "ᏭᏕᎵᎬ ᏗᏜ ᎠᏥᏂᏘᏂᎠ ᎪᎩ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "WAT": "ᏭᏕᎵᎬ ᎬᎿᎨᏍᏛ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "∅∅∅": "ᎠᏐᎴᏏ ᎪᎩ ᎠᏟᎢᎵᏒ", "LHDT": "ᎤᎬᏫᏳᎯ ᎭᏫ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HENOMX": "ᏧᏴᏢ ᏭᏕᎵᎬ ᎠᏂᏍᏆᏂ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "AEDT": "ᎡᎳᏗᏜ ᏗᎧᎸᎬ ᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "BOT": "ᏉᎵᏫᎠ ᎠᏟᎢᎵᏒ", "BT": "ᏊᏔᏂ ᎠᏟᎢᎵᏒ", "EST": "ᏗᎧᎸᎬ ᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "ACDT": "ᎠᏰᏟ ᎡᎳᏗᏜ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "HKT": "ᎰᏂᎩ ᎪᏂᎩ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "HKST": "ᎰᏂᎩ ᎪᏂᎩ ᎪᎩ ᎠᏟᎢᎵᏒ", "MEZ": "ᎠᏰᏟ ᏳᎳᏈ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "COT": "ᎪᎸᎻᏈᎢᎠ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "NZDT": "ᎢᏤ ᏏᎢᎴᏂᏗ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏒᎩ", "MYT": "ᎹᎴᏏᎢᎠ ᎠᏟᎢᎵᏒ", "ACST": "ᎠᏰᏟ ᎡᎳᏗᏜ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "GYT": "ᎦᏯᎾ ᎠᏟᎢᎵᏒ", "ECT": "ᎡᏆᏙᎵ ᎠᏟᎢᎵᏒ", "COST": "ᎪᎸᎻᏈᎢᎠ ᎪᎩ ᎠᏟᎢᎵᏒ", "CST": "ᎠᏰᏟ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "UYST": "ᏳᎷᏇ ᎪᎩ ᎠᏟᎢᎵᏒ", "GMT": "ᎢᏤ ᎢᏳᏍᏗ ᎠᏟᎢᎵᏒ", "AKDT": "ᎠᎳᏍᎦ ᎪᎯ ᎢᎦ ᎠᏟᎢᎵᏍᏒᎩ", "HNT": "ᎢᏤᎤᏂᏩᏛᏓᎦᏙᎯ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ", "UYT": "ᏳᎷᏇ ᎠᏟᎶᏍᏗ ᎠᏟᎢᎵᏒ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (chr *chr_US) Locale() string {
+ return chr.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'chr_US'
+func (chr *chr_US) PluralsCardinal() []locales.PluralRule {
+ return chr.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'chr_US'
+func (chr *chr_US) PluralsOrdinal() []locales.PluralRule {
+ return chr.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'chr_US'
+func (chr *chr_US) PluralsRange() []locales.PluralRule {
+ return chr.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'chr_US'
+func (chr *chr_US) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'chr_US'
+func (chr *chr_US) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'chr_US'
+func (chr *chr_US) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (chr *chr_US) MonthAbbreviated(month time.Month) string {
+ return chr.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (chr *chr_US) MonthsAbbreviated() []string {
+ return chr.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (chr *chr_US) MonthNarrow(month time.Month) string {
+ return chr.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (chr *chr_US) MonthsNarrow() []string {
+ return chr.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (chr *chr_US) MonthWide(month time.Month) string {
+ return chr.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (chr *chr_US) MonthsWide() []string {
+ return chr.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (chr *chr_US) WeekdayAbbreviated(weekday time.Weekday) string {
+ return chr.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (chr *chr_US) WeekdaysAbbreviated() []string {
+ return chr.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (chr *chr_US) WeekdayNarrow(weekday time.Weekday) string {
+ return chr.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (chr *chr_US) WeekdaysNarrow() []string {
+ return chr.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (chr *chr_US) WeekdayShort(weekday time.Weekday) string {
+ return chr.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (chr *chr_US) WeekdaysShort() []string {
+ return chr.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (chr *chr_US) WeekdayWide(weekday time.Weekday) string {
+ return chr.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (chr *chr_US) WeekdaysWide() []string {
+ return chr.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (chr *chr_US) Decimal() string {
+ return chr.decimal
+}
+
+// Group returns the group of number
+func (chr *chr_US) Group() string {
+ return chr.group
+}
+
+// Group returns the minus sign of number
+func (chr *chr_US) Minus() string {
+ return chr.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'chr_US' and handles both Whole and Real numbers based on 'v'
+func (chr *chr_US) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'chr_US' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (chr *chr_US) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, chr.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'chr_US'
+func (chr *chr_US) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := chr.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, chr.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, chr.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'chr_US'
+// in accounting notation.
+func (chr *chr_US) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := chr.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, chr.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, chr.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, chr.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, chr.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, chr.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'chr_US'
+func (chr *chr_US) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'chr_US'
+func (chr *chr_US) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'chr_US'
+func (chr *chr_US) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'chr_US'
+func (chr *chr_US) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, chr.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, chr.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'chr_US'
+func (chr *chr_US) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'chr_US'
+func (chr *chr_US) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'chr_US'
+func (chr *chr_US) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'chr_US'
+func (chr *chr_US) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, chr.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, chr.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, chr.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := chr.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/chr_US/chr_US_test.go b/vendor/github.com/go-playground/locales/chr_US/chr_US_test.go
new file mode 100644
index 000000000..348f842c8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/chr_US/chr_US_test.go
@@ -0,0 +1,1120 @@
+package chr_US
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "chr_US"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ckb/ckb.go b/vendor/github.com/go-playground/locales/ckb/ckb.go
new file mode 100644
index 000000000..7dde13286
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb/ckb.go
@@ -0,0 +1,668 @@
+package ckb
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ckb struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ckb' locale
+func New() locales.Translator {
+ return &ckb{
+ locale: "ckb",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "د.ع.\u200f", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ monthsNarrow: []string{"", "ک", "ش", "ئ", "ن", "ئ", "ح", "ت", "ئ", "ئ", "ت", "ت", "ک"},
+ monthsWide: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ daysAbbreviated: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ daysNarrow: []string{"ی", "د", "س", "چ", "پ", "ھ", "ش"},
+ daysShort: []string{"١ش", "٢ش", "٣ش", "٤ش", "٥ش", "ھ", "ش"},
+ daysWide: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ periodsAbbreviated: []string{"ب.ن", "د.ن"},
+ periodsNarrow: []string{"ب.ن", "د.ن"},
+ periodsWide: []string{"ب.ن", "د.ن"},
+ erasAbbreviated: []string{"پێش زایین", "زایینی"},
+ erasNarrow: []string{"پ.ن", "ز"},
+ erasWide: []string{"پێش زایین", "زایینی"},
+ timezones: map[string]string{"ACST": "ACST", "ACWDT": "ACWDT", "HNOG": "HNOG", "HKST": "HKST", "CAT": "CAT", "COT": "COT", "AWST": "AWST", "HNT": "HNT", "GMT": "GMT", "UYST": "UYST", "HEOG": "HEOG", "TMST": "TMST", "HECU": "HECU", "HNPMX": "HNPMX", "WIB": "WIB", "MYT": "MYT", "HEEG": "HEEG", "HAT": "HAT", "HEPM": "HEPM", "MST": "MST", "SRT": "SRT", "TMT": "TMT", "WAT": "WAT", "WAST": "WAST", "ARST": "ARST", "COST": "COST", "HNCU": "HNCU", "GFT": "GFT", "AKST": "AKST", "ACWST": "ACWST", "LHDT": "LHDT", "OESZ": "OESZ", "ART": "ART", "BOT": "BOT", "WART": "WART", "HNPM": "HNPM", "EAT": "EAT", "SAST": "SAST", "NZDT": "NZDT", "ECT": "ECT", "ADT": "ADT", "WEZ": "WEZ", "AKDT": "AKDT", "HKT": "HKT", "WARST": "WARST", "WITA": "WITA", "BT": "BT", "HENOMX": "HENOMX", "WIT": "WIT", "HADT": "HADT", "AST": "AST", "AEDT": "AEDT", "NZST": "NZST", "UYT": "UYT", "CHADT": "CHADT", "CDT": "CDT", "CHAST": "CHAST", "PDT": "PDT", "SGT": "SGT", "ACDT": "ACDT", "VET": "VET", "OEZ": "OEZ", "HAST": "HAST", "ChST": "ChST", "HNNOMX": "HNNOMX", "AWDT": "AWDT", "JDT": "JDT", "HNEG": "HNEG", "CLT": "CLT", "CLST": "CLST", "CST": "CST", "MESZ": "MESZ", "PST": "PST", "JST": "JST", "MEZ": "MEZ", "EDT": "EDT", "IST": "IST", "LHST": "LHST", "AEST": "AEST", "WESZ": "WESZ", "EST": "EST", "HEPMX": "HEPMX", "MDT": "MDT", "∅∅∅": "∅∅∅", "GYT": "GYT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ckb *ckb) Locale() string {
+ return ckb.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ckb'
+func (ckb *ckb) PluralsCardinal() []locales.PluralRule {
+ return ckb.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ckb'
+func (ckb *ckb) PluralsOrdinal() []locales.PluralRule {
+ return ckb.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ckb'
+func (ckb *ckb) PluralsRange() []locales.PluralRule {
+ return ckb.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ckb'
+func (ckb *ckb) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ckb'
+func (ckb *ckb) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ckb'
+func (ckb *ckb) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ckb *ckb) MonthAbbreviated(month time.Month) string {
+ return ckb.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ckb *ckb) MonthsAbbreviated() []string {
+ return ckb.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ckb *ckb) MonthNarrow(month time.Month) string {
+ return ckb.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ckb *ckb) MonthsNarrow() []string {
+ return ckb.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ckb *ckb) MonthWide(month time.Month) string {
+ return ckb.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ckb *ckb) MonthsWide() []string {
+ return ckb.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ckb *ckb) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ckb.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ckb *ckb) WeekdaysAbbreviated() []string {
+ return ckb.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ckb *ckb) WeekdayNarrow(weekday time.Weekday) string {
+ return ckb.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ckb *ckb) WeekdaysNarrow() []string {
+ return ckb.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ckb *ckb) WeekdayShort(weekday time.Weekday) string {
+ return ckb.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ckb *ckb) WeekdaysShort() []string {
+ return ckb.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ckb *ckb) WeekdayWide(weekday time.Weekday) string {
+ return ckb.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ckb *ckb) WeekdaysWide() []string {
+ return ckb.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ckb *ckb) Decimal() string {
+ return ckb.decimal
+}
+
+// Group returns the group of number
+func (ckb *ckb) Group() string {
+ return ckb.group
+}
+
+// Group returns the minus sign of number
+func (ckb *ckb) Minus() string {
+ return ckb.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ckb' and handles both Whole and Real numbers based on 'v'
+func (ckb *ckb) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 6 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ckb' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ckb *ckb) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ckb.percentSuffix...)
+
+ b = append(b, ckb.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ckb'
+func (ckb *ckb) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ckb'
+// in accounting notation.
+func (ckb *ckb) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ckb.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ckb'
+func (ckb *ckb) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ckb'
+func (ckb *ckb) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ckb'
+func (ckb *ckb) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ckb'
+func (ckb *ckb) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, ckb.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ckb'
+func (ckb *ckb) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ckb'
+func (ckb *ckb) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ckb'
+func (ckb *ckb) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ckb'
+func (ckb *ckb) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ckb.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ckb/ckb_test.go b/vendor/github.com/go-playground/locales/ckb/ckb_test.go
new file mode 100644
index 000000000..f554f2ea2
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb/ckb_test.go
@@ -0,0 +1,1120 @@
+package ckb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ.go b/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ.go
new file mode 100644
index 000000000..09b9f2e14
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ.go
@@ -0,0 +1,668 @@
+package ckb_IQ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ckb_IQ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ckb_IQ' locale
+func New() locales.Translator {
+ return &ckb_IQ{
+ locale: "ckb_IQ",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ monthsNarrow: []string{"", "ک", "ش", "ئ", "ن", "ئ", "ح", "ت", "ئ", "ئ", "ت", "ت", "ک"},
+ monthsWide: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ daysAbbreviated: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ daysNarrow: []string{"ی", "د", "س", "چ", "پ", "ھ", "ش"},
+ daysShort: []string{"١ش", "٢ش", "٣ش", "٤ش", "٥ش", "ھ", "ش"},
+ daysWide: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ periodsAbbreviated: []string{"ب.ن", "د.ن"},
+ periodsNarrow: []string{"ب.ن", "د.ن"},
+ periodsWide: []string{"ب.ن", "د.ن"},
+ erasAbbreviated: []string{"پێش زایین", "زایینی"},
+ erasNarrow: []string{"پ.ن", "ز"},
+ erasWide: []string{"پێش زایین", "زایینی"},
+ timezones: map[string]string{"ARST": "ARST", "COST": "COST", "CHAST": "CHAST", "GFT": "GFT", "HEEG": "HEEG", "IST": "IST", "UYST": "UYST", "WAST": "WAST", "BT": "BT", "NZST": "NZST", "∅∅∅": "∅∅∅", "WARST": "WARST", "HNNOMX": "HNNOMX", "CLST": "CLST", "PST": "PST", "WAT": "WAT", "LHST": "LHST", "HEPM": "HEPM", "ChST": "ChST", "HEPMX": "HEPMX", "JST": "JST", "ACWST": "ACWST", "HKST": "HKST", "TMT": "TMT", "COT": "COT", "ADT": "ADT", "BOT": "BOT", "HNEG": "HNEG", "HNOG": "HNOG", "MEZ": "MEZ", "WART": "WART", "HNPMX": "HNPMX", "AST": "AST", "WESZ": "WESZ", "HNPM": "HNPM", "TMST": "TMST", "CST": "CST", "WEZ": "WEZ", "NZDT": "NZDT", "PDT": "PDT", "EST": "EST", "LHDT": "LHDT", "HENOMX": "HENOMX", "MST": "MST", "GMT": "GMT", "CHADT": "CHADT", "CDT": "CDT", "SAST": "SAST", "JDT": "JDT", "VET": "VET", "WITA": "WITA", "OEZ": "OEZ", "WIB": "WIB", "MYT": "MYT", "EDT": "EDT", "SRT": "SRT", "EAT": "EAT", "WIT": "WIT", "UYT": "UYT", "HEOG": "HEOG", "MESZ": "MESZ", "HKT": "HKT", "HECU": "HECU", "AKST": "AKST", "SGT": "SGT", "HNT": "HNT", "CAT": "CAT", "HAST": "HAST", "ART": "ART", "ECT": "ECT", "ACWDT": "ACWDT", "MDT": "MDT", "OESZ": "OESZ", "AWST": "AWST", "AWDT": "AWDT", "AEDT": "AEDT", "AKDT": "AKDT", "ACST": "ACST", "ACDT": "ACDT", "HAT": "HAT", "HADT": "HADT", "AEST": "AEST", "CLT": "CLT", "GYT": "GYT", "HNCU": "HNCU"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ckb *ckb_IQ) Locale() string {
+ return ckb.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ckb_IQ'
+func (ckb *ckb_IQ) PluralsCardinal() []locales.PluralRule {
+ return ckb.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ckb_IQ'
+func (ckb *ckb_IQ) PluralsOrdinal() []locales.PluralRule {
+ return ckb.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ckb_IQ'
+func (ckb *ckb_IQ) PluralsRange() []locales.PluralRule {
+ return ckb.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ckb_IQ'
+func (ckb *ckb_IQ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ckb_IQ'
+func (ckb *ckb_IQ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ckb_IQ'
+func (ckb *ckb_IQ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ckb *ckb_IQ) MonthAbbreviated(month time.Month) string {
+ return ckb.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ckb *ckb_IQ) MonthsAbbreviated() []string {
+ return ckb.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ckb *ckb_IQ) MonthNarrow(month time.Month) string {
+ return ckb.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ckb *ckb_IQ) MonthsNarrow() []string {
+ return ckb.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ckb *ckb_IQ) MonthWide(month time.Month) string {
+ return ckb.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ckb *ckb_IQ) MonthsWide() []string {
+ return ckb.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ckb *ckb_IQ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ckb.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ckb *ckb_IQ) WeekdaysAbbreviated() []string {
+ return ckb.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ckb *ckb_IQ) WeekdayNarrow(weekday time.Weekday) string {
+ return ckb.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ckb *ckb_IQ) WeekdaysNarrow() []string {
+ return ckb.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ckb *ckb_IQ) WeekdayShort(weekday time.Weekday) string {
+ return ckb.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ckb *ckb_IQ) WeekdaysShort() []string {
+ return ckb.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ckb *ckb_IQ) WeekdayWide(weekday time.Weekday) string {
+ return ckb.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ckb *ckb_IQ) WeekdaysWide() []string {
+ return ckb.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ckb *ckb_IQ) Decimal() string {
+ return ckb.decimal
+}
+
+// Group returns the group of number
+func (ckb *ckb_IQ) Group() string {
+ return ckb.group
+}
+
+// Group returns the minus sign of number
+func (ckb *ckb_IQ) Minus() string {
+ return ckb.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ckb_IQ' and handles both Whole and Real numbers based on 'v'
+func (ckb *ckb_IQ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 6 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ckb_IQ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ckb *ckb_IQ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ckb.percentSuffix...)
+
+ b = append(b, ckb.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ckb_IQ'
+// in accounting notation.
+func (ckb *ckb_IQ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ckb.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, ckb.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ckb_IQ'
+func (ckb *ckb_IQ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, ckb.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ckb.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ckb.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ_test.go b/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ_test.go
new file mode 100644
index 000000000..51c244e5e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb_IQ/ckb_IQ_test.go
@@ -0,0 +1,1120 @@
+package ckb_IQ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb_IQ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR.go b/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR.go
new file mode 100644
index 000000000..c9281daeb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR.go
@@ -0,0 +1,630 @@
+package ckb_IR
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ckb_IR struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ckb_IR' locale
+func New() locales.Translator {
+ return &ckb_IR{
+ locale: "ckb_IR",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: "٫",
+ group: "٬",
+ minus: "-",
+ percent: "٪",
+ perMille: "؉",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ monthsNarrow: []string{"", "ک", "ش", "ئ", "ن", "ئ", "ح", "ت", "ئ", "ئ", "ت", "ت", "ک"},
+ monthsWide: []string{"", "کانوونی دووەم", "شوبات", "ئازار", "نیسان", "ئایار", "حوزەیران", "تەمووز", "ئاب", "ئەیلوول", "تشرینی یەکەم", "تشرینی دووەم", "کانونی یەکەم"},
+ daysAbbreviated: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ daysNarrow: []string{"ی", "د", "س", "چ", "پ", "ھ", "ش"},
+ daysShort: []string{"١ش", "٢ش", "٣ش", "٤ش", "٥ش", "ھ", "ش"},
+ daysWide: []string{"یەکشەممە", "دووشەممە", "سێشەممە", "چوارشەممە", "پێنجشەممە", "ھەینی", "شەممە"},
+ periodsAbbreviated: []string{"ب.ن", "د.ن"},
+ periodsNarrow: []string{"ب.ن", "د.ن"},
+ periodsWide: []string{"ب.ن", "د.ن"},
+ erasAbbreviated: []string{"پێش زایین", "زایینی"},
+ erasNarrow: []string{"پ.ن", "ز"},
+ erasWide: []string{"پێش زایین", "زایینی"},
+ timezones: map[string]string{"HEPM": "HEPM", "HADT": "HADT", "PDT": "PDT", "EST": "EST", "GMT": "GMT", "HNCU": "HNCU", "BT": "BT", "EDT": "EDT", "WART": "WART", "MDT": "MDT", "OEZ": "OEZ", "WAT": "WAT", "NZDT": "NZDT", "LHDT": "LHDT", "OESZ": "OESZ", "HNPMX": "HNPMX", "HAT": "HAT", "CLT": "CLT", "NZST": "NZST", "HEEG": "HEEG", "HENOMX": "HENOMX", "WEZ": "WEZ", "WESZ": "WESZ", "BOT": "BOT", "AKDT": "AKDT", "ACWST": "ACWST", "MEZ": "MEZ", "LHST": "LHST", "TMST": "TMST", "CHADT": "CHADT", "ACST": "ACST", "MESZ": "MESZ", "VET": "VET", "WIT": "WIT", "AWST": "AWST", "AST": "AST", "WIB": "WIB", "HNOG": "HNOG", "WARST": "WARST", "EAT": "EAT", "CLST": "CLST", "UYT": "UYT", "HECU": "HECU", "WITA": "WITA", "HAST": "HAST", "HEPMX": "HEPMX", "HKT": "HKT", "ARST": "ARST", "AEST": "AEST", "AEDT": "AEDT", "MYT": "MYT", "SGT": "SGT", "CAT": "CAT", "COST": "COST", "PST": "PST", "AWDT": "AWDT", "WAST": "WAST", "JDT": "JDT", "HEOG": "HEOG", "HNT": "HNT", "HNNOMX": "HNNOMX", "ART": "ART", "CHAST": "CHAST", "JST": "JST", "ADT": "ADT", "ECT": "ECT", "ACDT": "ACDT", "HKST": "HKST", "IST": "IST", "HNPM": "HNPM", "COT": "COT", "UYST": "UYST", "ACWDT": "ACWDT", "∅∅∅": "∅∅∅", "TMT": "TMT", "ChST": "ChST", "GFT": "GFT", "AKST": "AKST", "SAST": "SAST", "HNEG": "HNEG", "SRT": "SRT", "MST": "MST", "GYT": "GYT", "CST": "CST", "CDT": "CDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ckb *ckb_IR) Locale() string {
+ return ckb.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ckb_IR'
+func (ckb *ckb_IR) PluralsCardinal() []locales.PluralRule {
+ return ckb.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ckb_IR'
+func (ckb *ckb_IR) PluralsOrdinal() []locales.PluralRule {
+ return ckb.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ckb_IR'
+func (ckb *ckb_IR) PluralsRange() []locales.PluralRule {
+ return ckb.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ckb_IR'
+func (ckb *ckb_IR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ckb_IR'
+func (ckb *ckb_IR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ckb_IR'
+func (ckb *ckb_IR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ckb *ckb_IR) MonthAbbreviated(month time.Month) string {
+ return ckb.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ckb *ckb_IR) MonthsAbbreviated() []string {
+ return ckb.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ckb *ckb_IR) MonthNarrow(month time.Month) string {
+ return ckb.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ckb *ckb_IR) MonthsNarrow() []string {
+ return ckb.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ckb *ckb_IR) MonthWide(month time.Month) string {
+ return ckb.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ckb *ckb_IR) MonthsWide() []string {
+ return ckb.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ckb *ckb_IR) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ckb.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ckb *ckb_IR) WeekdaysAbbreviated() []string {
+ return ckb.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ckb *ckb_IR) WeekdayNarrow(weekday time.Weekday) string {
+ return ckb.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ckb *ckb_IR) WeekdaysNarrow() []string {
+ return ckb.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ckb *ckb_IR) WeekdayShort(weekday time.Weekday) string {
+ return ckb.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ckb *ckb_IR) WeekdaysShort() []string {
+ return ckb.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ckb *ckb_IR) WeekdayWide(weekday time.Weekday) string {
+ return ckb.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ckb *ckb_IR) WeekdaysWide() []string {
+ return ckb.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ckb *ckb_IR) Decimal() string {
+ return ckb.decimal
+}
+
+// Group returns the group of number
+func (ckb *ckb_IR) Group() string {
+ return ckb.group
+}
+
+// Group returns the minus sign of number
+func (ckb *ckb_IR) Minus() string {
+ return ckb.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ckb_IR' and handles both Whole and Real numbers based on 'v'
+func (ckb *ckb_IR) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 6 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ckb_IR' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ckb *ckb_IR) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 10
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ckb.percentSuffix...)
+
+ b = append(b, ckb.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ckb_IR'
+func (ckb *ckb_IR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ckb_IR'
+// in accounting notation.
+func (ckb *ckb_IR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ckb.currencies[currency]
+ l := len(s) + len(symbol) + 8 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ for j := len(ckb.decimal) - 1; j >= 0; j-- {
+ b = append(b, ckb.decimal[j])
+ }
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(ckb.group) - 1; j >= 0; j-- {
+ b = append(b, ckb.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(ckb.minus) - 1; j >= 0; j-- {
+ b = append(b, ckb.minus[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ckb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ckb.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, ckb.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0xdb, 0x8c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, ckb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, ckb.daysWide[t.Weekday()]...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ckb_IR'
+func (ckb *ckb_IR) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ckb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ckb.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR_test.go b/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR_test.go
new file mode 100644
index 000000000..0e4010279
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ckb_IR/ckb_IR_test.go
@@ -0,0 +1,1120 @@
+package ckb_IR
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ckb_IR"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cmd/README.md b/vendor/github.com/go-playground/locales/cmd/README.md
new file mode 100644
index 000000000..b33ff22c8
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/README.md
@@ -0,0 +1,6 @@
+Resources can be downloaded from [http://cldr.unicode.org/index/downloads](http://cldr.unicode.org/index/downloads)
+
+extract them under the data folder in this directory.
+
+If any errors, or problems with the CLDR rules are encountered I strongly encourage contributing to the CLDR project and/or
+adding the exceptions to `generate_resources.go`; any changes/fixes made directly to the generated locales will be rejected.
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/cmd/currency.tmpl b/vendor/github.com/go-playground/locales/cmd/currency.tmpl
new file mode 100644
index 000000000..80c83eeeb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/currency.tmpl
@@ -0,0 +1,11 @@
+{{ define "currencies" }}
+package currency
+
+// Type is the currency type associated with the locales currency enum
+type Type int
+
+// locale currencies
+const (
+ {{ . }}
+)
+{{ end }}
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/cmd/data/.gitignore b/vendor/github.com/go-playground/locales/cmd/data/.gitignore
new file mode 100644
index 000000000..86d0cb272
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/data/.gitignore
@@ -0,0 +1,4 @@
+# Ignore everything in this directory
+*
+# Except this file
+!.gitignore
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/cmd/generate_resources.go b/vendor/github.com/go-playground/locales/cmd/generate_resources.go
new file mode 100644
index 000000000..a7713959b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/generate_resources.go
@@ -0,0 +1,2895 @@
+package main
+
+import (
+ "fmt"
+ "log"
+ "os"
+ "os/exec"
+ "regexp"
+ "sort"
+ "strconv"
+ "strings"
+
+ "github.com/go-playground/locales"
+
+ "golang.org/x/text/unicode/cldr"
+
+ "text/template"
+)
+
+const (
+ locDir = "../%s"
+ locFilename = locDir + "/%s.go"
+)
+
+var (
+ tfuncs = template.FuncMap{
+ "is_multibyte": func(s string) bool {
+ return len([]byte(s)) > 1
+ },
+ "reverse_bytes": func(s string) string {
+ b := make([]byte, 0, 8)
+
+ for j := len(s) - 1; j >= 0; j-- {
+ b = append(b, s[j])
+ }
+
+ return fmt.Sprintf("%#v", b)
+ },
+ "byte_count": func(s ...string) string {
+ var count int
+
+ for i := 0; i < len(s); i++ {
+ count += len([]byte(s[i]))
+ }
+
+ return strconv.Itoa(count)
+ },
+ }
+ prVarFuncs = map[string]string{
+ "n": "n := math.Abs(num)\n",
+ "i": "i := int64(n)\n",
+ // "v": "v := ...", // inherently available as argument
+ "w": "w := locales.W(n, v)\n",
+ "f": "f := locales.F(n, v)\n",
+ "t": "t := locales.T(n, v)\n",
+ }
+
+ translators = make(map[string]*translator)
+ baseTranslators = make(map[string]*translator)
+ globalCurrenciesMap = make(map[string]struct{}) // ["USD"] = "$" currency code, just all currencies for mapping to enum
+ globCurrencyIdxMap = make(map[string]int) // ["USD"] = 0
+ globalCurrencies = make([]string, 0, 100) // array of currency codes index maps to enum
+ tmpl *template.Template
+ nModRegex = regexp.MustCompile("(n%[0-9]+)")
+ iModRegex = regexp.MustCompile("(i%[0-9]+)")
+ wModRegex = regexp.MustCompile("(w%[0-9]+)")
+ fModRegex = regexp.MustCompile("(f%[0-9]+)")
+ tModRegex = regexp.MustCompile("(t%[0-9]+)")
+ groupLenRegex = regexp.MustCompile(",([0-9#]+)\\.")
+ groupLenPercentRegex = regexp.MustCompile(",([0-9#]+)$")
+ secondaryGroupLenRegex = regexp.MustCompile(",([0-9#]+),")
+ requiredNumRegex = regexp.MustCompile("([0-9]+)\\.")
+ requiredDecimalRegex = regexp.MustCompile("\\.([0-9]+)")
+
+ enInheritance = map[string]string{
+ "en_150": "en_001", "en_AG": "en_001", "en_AI": "en_001", "en_AU": "en_001", "en_BB": "en_001", "en_BE": "en_001", "en_BM": "en_001", "en_BS": "en_001", "en_BW": "en_001", "en_BZ": "en_001", "en_CA": "en_001", "en_CC": "en_001", "en_CK": "en_001", "en_CM": "en_001", "en_CX": "en_001", "en_CY": "en_001", "en_DG": "en_001", "en_DM": "en_001", "en_ER": "en_001", "en_FJ": "en_001", "en_FK": "en_001", "en_FM": "en_001", "en_GB": "en_001", "en_GD": "en_001", "en_GG": "en_001", "en_GH": "en_001", "en_GI": "en_001", "en_GM": "en_001", "en_GY": "en_001", "en_HK": "en_001", "en_IE": "en_001", "en_IL": "en_001", "en_IM": "en_001", "en_IN": "en_001", "en_IO": "en_001", "en_JE": "en_001", "en_JM": "en_001", "en_KE": "en_001", "en_KI": "en_001", "en_KN": "en_001", "en_KY": "en_001", "en_LC": "en_001", "en_LR": "en_001", "en_LS": "en_001", "en_MG": "en_001", "en_MO": "en_001", "en_MS": "en_001", "en_MT": "en_001", "en_MU": "en_001", "en_MW": "en_001", "en_MY": "en_001", "en_NA": "en_001", "en_NF": "en_001", "en_NG": "en_001", "en_NR": "en_001", "en_NU": "en_001", "en_NZ": "en_001", "en_PG": "en_001", "en_PH": "en_001", "en_PK": "en_001", "en_PN": "en_001", "en_PW": "en_001", "en_RW": "en_001", "en_SB": "en_001", "en_SC": "en_001", "en_SD": "en_001", "en_SG": "en_001", "en_SH": "en_001", "en_SL": "en_001", "en_SS": "en_001", "en_SX": "en_001", "en_SZ": "en_001", "en_TC": "en_001", "en_TK": "en_001", "en_TO": "en_001", "en_TT": "en_001", "en_TV": "en_001", "en_TZ": "en_001", "en_UG": "en_001", "en_VC": "en_001", "en_VG": "en_001", "en_VU": "en_001", "en_WS": "en_001", "en_ZA": "en_001", "en_ZM": "en_001", "en_ZW": "en_001", }
+ en150Inheritance = map[string]string{"en_AT": "en_150", "en_CH": "en_150", "en_DE": "en_150", "en_DK": "en_150", "en_FI": "en_150", "en_NL": "en_150", "en_SE": "en_150", "en_SI": "en_150"}
+ es419Inheritance = map[string]string{
+ "es_AR": "es_419", "es_BO": "es_419", "es_BR": "es_419", "es_BZ": "es_419", "es_CL": "es_419", "es_CO": "es_419", "es_CR": "es_419", "es_CU": "es_419", "es_DO": "es_419", "es_EC": "es_419", "es_GT": "es_419", "es_HN": "es_419", "es_MX": "es_419", "es_NI": "es_419", "es_PA": "es_419", "es_PE": "es_419", "es_PR": "es_419", "es_PY": "es_419", "es_SV": "es_419", "es_US": "es_419", "es_UY": "es_419", "es_VE": "es_419",
+ }
+ rootInheritance = map[string]string{
+ "az_Arab": "root", "az_Cyrl": "root", "bm_Nkoo": "root", "bs_Cyrl": "root", "en_Dsrt": "root", "en_Shaw": "root", "ha_Arab": "root", "iu_Latn": "root", "mn_Mong": "root", "ms_Arab": "root", "pa_Arab": "root", "shi_Latn": "root", "sr_Latn": "root", "uz_Arab": "root", "uz_Cyrl": "root", "vai_Latn": "root", "zh_Hant": "root", "yue_Hans": "root",
+ }
+ ptPtInheritance = map[string]string{
+ "pt_AO": "pt_PT", "pt_CH": "pt_PT", "pt_CV": "pt_PT", "pt_GQ": "pt_PT", "pt_GW": "pt_PT", "pt_LU": "pt_PT", "pt_MO": "pt_PT", "pt_MZ": "pt_PT", "pt_ST": "pt_PT", "pt_TL": "pt_PT",
+ }
+ zhHantHKInheritance = map[string]string{
+ "zh_Hant_MO": "zh_Hant_HK",
+ }
+
+ inheritMaps = []map[string]string{ enInheritance, en150Inheritance, es419Inheritance, rootInheritance, ptPtInheritance, zhHantHKInheritance}
+)
+
+type translator struct {
+ Locale string
+ BaseLocale string
+ // InheritedLocale string
+ Plurals string
+ CardinalFunc string
+ PluralsOrdinal string
+ OrdinalFunc string
+ PluralsRange string
+ RangeFunc string
+ Decimal string
+ Group string
+ Minus string
+ Percent string
+ PerMille string
+ TimeSeparator string
+ Infinity string
+ Currencies string
+
+ // FmtNumber vars
+ FmtNumberExists bool
+ FmtNumberGroupLen int
+ FmtNumberSecondaryGroupLen int
+ FmtNumberMinDecimalLen int
+
+ // FmtPercent vars
+ FmtPercentExists bool
+ FmtPercentGroupLen int
+ FmtPercentSecondaryGroupLen int
+ FmtPercentMinDecimalLen int
+ FmtPercentPrefix string
+ FmtPercentSuffix string
+ FmtPercentInPrefix bool
+ FmtPercentLeft bool
+
+ // FmtCurrency vars
+ FmtCurrencyExists bool
+ FmtCurrencyGroupLen int
+ FmtCurrencySecondaryGroupLen int
+ FmtCurrencyMinDecimalLen int
+ FmtCurrencyPrefix string
+ FmtCurrencySuffix string
+ FmtCurrencyInPrefix bool
+ FmtCurrencyLeft bool
+ FmtCurrencyNegativeExists bool
+ FmtCurrencyNegativePrefix string
+ FmtCurrencyNegativeSuffix string
+ FmtCurrencyNegativeInPrefix bool
+ FmtCurrencyNegativeLeft bool
+
+ // Date & Time
+ FmtCalendarExists bool
+
+ FmtMonthsAbbreviated string
+ FmtMonthsNarrow string
+ FmtMonthsWide string
+
+ FmtDaysAbbreviated string
+ FmtDaysNarrow string
+ FmtDaysShort string
+ FmtDaysWide string
+
+ FmtPeriodsAbbreviated string
+ FmtPeriodsNarrow string
+ FmtPeriodsShort string
+ FmtPeriodsWide string
+
+ FmtErasAbbreviated string
+ FmtErasNarrow string
+ FmtErasWide string
+
+ FmtTimezones string
+
+ // calculation only fields below this point...
+ DecimalNumberFormat string
+ PercentNumberFormat string
+ CurrencyNumberFormat string
+ NegativeCurrencyNumberFormat string
+
+ // Dates
+ FmtDateFull string
+ FmtDateLong string
+ FmtDateMedium string
+ FmtDateShort string
+
+ // Times
+ FmtTimeFull string
+ FmtTimeLong string
+ FmtTimeMedium string
+ FmtTimeShort string
+
+ // timezones per locale by type
+ timezones map[string]*zoneAbbrev // key = type eg. America_Eastern zone Abbrev will be long form eg. Eastern Standard Time, Pacific Standard Time.....
+}
+
+type zoneAbbrev struct {
+ standard string
+ daylight string
+}
+
+var timezones = map[string]*zoneAbbrev{} // key = type eg. America_Eastern zone Abbrev eg. EST & EDT
+
+func main() {
+
+ var err error
+
+ // load template
+ tmpl, err = template.New("all").Funcs(tfuncs).ParseGlob("*.tmpl")
+ if err != nil {
+ log.Fatal(err)
+ }
+
+ // load CLDR recourses
+ var decoder cldr.Decoder
+
+ cldr, err := decoder.DecodePath("data/core")
+ if err != nil {
+ panic("failed decode CLDR data; " + err.Error())
+ }
+
+ preProcess(cldr)
+ postProcess(cldr)
+
+ var currencies string
+
+ for i, curr := range globalCurrencies {
+
+ if i == 0 {
+ currencies = curr + " Type = iota\n"
+ continue
+ }
+
+ currencies += curr + "\n"
+ }
+
+ if err = os.MkdirAll(fmt.Sprintf(locDir, "currency"), 0777); err != nil {
+ log.Fatal(err)
+ }
+
+ filename := fmt.Sprintf(locFilename, "currency", "currency")
+
+ output, err := os.Create(filename)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer output.Close()
+
+ if err := tmpl.ExecuteTemplate(output, "currencies", currencies); err != nil {
+ log.Fatal(err)
+ }
+
+ output.Close()
+
+ // after file written run gofmt on file to ensure best formatting
+ cmd := exec.Command("goimports", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"goimports\" for file ", filename, ": ", err)
+ }
+
+ cmd = exec.Command("gofmt", "-s", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"gofmt\" for file ", filename, ": ", err)
+ }
+
+ for _, trans := range translators {
+ fmt.Println("Writing Data:", trans.Locale)
+
+ if err = os.MkdirAll(fmt.Sprintf(locDir, trans.Locale), 0777); err != nil {
+ log.Fatal(err)
+ }
+
+ filename = fmt.Sprintf(locFilename, trans.Locale, trans.Locale)
+
+ output, err := os.Create(filename)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer output.Close()
+
+ if err := tmpl.ExecuteTemplate(output, "translator", trans); err != nil {
+ log.Fatal(err)
+ }
+
+ output.Close()
+
+ // after file written run gofmt on file to ensure best formatting
+ cmd := exec.Command("goimports", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"goimports\" for file ", filename, ": ", err)
+ }
+
+ // this simplifies some syntax that I can;t find an option for in goimports, namely '-s'
+ cmd = exec.Command("gofmt", "-s", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"gofmt\" for file ", filename, ": ", err)
+ }
+
+ filename = fmt.Sprintf(locFilename, trans.Locale, trans.Locale+"_test")
+
+ if _, err := os.Stat(filename); err == nil {
+ fmt.Println("*************** test file exists, skipping:", filename)
+ continue
+ }
+
+ output, err = os.Create(filename)
+ if err != nil {
+ log.Fatal(err)
+ }
+ defer output.Close()
+
+ if err := tmpl.ExecuteTemplate(output, "tests", trans); err != nil {
+ log.Fatal(err)
+ }
+
+ output.Close()
+
+ // after file written run gofmt on file to ensure best formatting
+ cmd = exec.Command("goimports", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"goimports\" for file ", filename, ": ", err)
+ }
+
+ // this simplifies some syntax that I can;t find an option for in goimports, namely '-s'
+ cmd = exec.Command("gofmt", "-s", "-w", filename)
+ if err = cmd.Run(); err != nil {
+ log.Panic("failed execute \"gofmt\" for file ", filename, ": ", err)
+ }
+ }
+}
+
+func applyOverrides(trans *translator) {
+
+ if trans.BaseLocale == "ru" {
+ trans.PercentNumberFormat = "#,##0%"
+ }
+}
+
+func postProcess(cldr *cldr.CLDR) {
+
+ for _, v := range timezones {
+
+ // no DST
+ if len(v.daylight) == 0 {
+ v.daylight = v.standard
+ }
+ }
+
+ var inherited *translator
+ var base *translator
+ var inheritedFound, baseFound bool
+
+ for _, trans := range translators {
+
+ fmt.Println("Post Processing:", trans.Locale)
+
+ // cardinal plural rules
+ trans.CardinalFunc, trans.Plurals = parseCardinalPluralRuleFunc(cldr, trans.Locale, trans.BaseLocale)
+
+ //ordinal plural rules
+ trans.OrdinalFunc, trans.PluralsOrdinal = parseOrdinalPluralRuleFunc(cldr, trans.BaseLocale)
+
+ // range plural rules
+ trans.RangeFunc, trans.PluralsRange = parseRangePluralRuleFunc(cldr, trans.BaseLocale)
+
+ // ignore base locales
+ if trans.BaseLocale == trans.Locale {
+ inheritedFound = false
+ baseFound = false
+ } else {
+
+ inheritedFound = false
+
+ for _, inheritMap := range(inheritMaps) {
+ if inherit, found := inheritMap[trans.Locale]; found {
+ inherited, inheritedFound = translators[inherit]
+ break;
+ }
+ }
+
+ base, baseFound = baseTranslators[trans.BaseLocale]
+ }
+
+ // Numbers
+
+ if len(trans.Decimal) == 0 {
+
+ if inheritedFound {
+ trans.Decimal = inherited.Decimal
+ }
+
+ if len(trans.Decimal) == 0 && baseFound {
+ trans.Decimal = base.Decimal
+ }
+
+ if len(trans.Decimal) == 0 {
+ trans.Decimal = ""
+ }
+ }
+
+ if len(trans.Group) == 0 {
+
+ if inheritedFound {
+ trans.Group = inherited.Group
+ }
+
+ if len(trans.Group) == 0 && baseFound {
+ trans.Group = base.Group
+ }
+
+ if len(trans.Group) == 0 {
+ trans.Group = ""
+ }
+ }
+
+ if len(trans.Minus) == 0 {
+
+ if inheritedFound {
+ trans.Minus = inherited.Minus
+ }
+
+ if len(trans.Minus) == 0 && baseFound {
+ trans.Minus = base.Minus
+ }
+
+ if len(trans.Minus) == 0 {
+ trans.Minus = ""
+ }
+ }
+
+ if len(trans.Percent) == 0 {
+
+ if inheritedFound {
+ trans.Percent = inherited.Percent
+ }
+
+ if len(trans.Percent) == 0 && baseFound {
+ trans.Percent = base.Percent
+ }
+
+ if len(trans.Percent) == 0 {
+ trans.Percent = ""
+ }
+ }
+
+ if len(trans.PerMille) == 0 {
+
+ if inheritedFound {
+ trans.PerMille = inherited.PerMille
+ }
+
+ if len(trans.PerMille) == 0 && baseFound {
+ trans.PerMille = base.PerMille
+ }
+
+ if len(trans.PerMille) == 0 {
+ trans.PerMille = ""
+ }
+ }
+
+ if len(trans.TimeSeparator) == 0 && inheritedFound {
+ trans.TimeSeparator = inherited.TimeSeparator
+ }
+
+ if len(trans.TimeSeparator) == 0 && baseFound {
+ trans.TimeSeparator = base.TimeSeparator
+ }
+
+ if len(trans.Infinity) == 0 && inheritedFound {
+ trans.Infinity = inherited.Infinity
+ }
+
+ if len(trans.Infinity) == 0 && baseFound {
+ trans.Infinity = base.Infinity
+ }
+
+ // Currency
+
+ // number values
+
+ if len(trans.DecimalNumberFormat) == 0 && inheritedFound {
+ trans.DecimalNumberFormat = inherited.DecimalNumberFormat
+ }
+
+ if len(trans.DecimalNumberFormat) == 0 && baseFound {
+ trans.DecimalNumberFormat = base.DecimalNumberFormat
+ }
+
+ if len(trans.PercentNumberFormat) == 0 && inheritedFound {
+ trans.PercentNumberFormat = inherited.PercentNumberFormat
+ }
+
+ if len(trans.PercentNumberFormat) == 0 && baseFound {
+ trans.PercentNumberFormat = base.PercentNumberFormat
+ }
+
+ if len(trans.CurrencyNumberFormat) == 0 && inheritedFound {
+ trans.CurrencyNumberFormat = inherited.CurrencyNumberFormat
+ }
+
+ if len(trans.CurrencyNumberFormat) == 0 && baseFound {
+ trans.CurrencyNumberFormat = base.CurrencyNumberFormat
+ }
+
+ if len(trans.NegativeCurrencyNumberFormat) == 0 && inheritedFound {
+ trans.NegativeCurrencyNumberFormat = inherited.NegativeCurrencyNumberFormat
+ }
+
+ if len(trans.NegativeCurrencyNumberFormat) == 0 && baseFound {
+ trans.NegativeCurrencyNumberFormat = base.NegativeCurrencyNumberFormat
+ }
+
+ // date values
+
+ if len(trans.FmtDateFull) == 0 && inheritedFound {
+ trans.FmtDateFull = inherited.FmtDateFull
+ }
+
+ if len(trans.FmtDateFull) == 0 && baseFound {
+ trans.FmtDateFull = base.FmtDateFull
+ }
+
+ if len(trans.FmtDateLong) == 0 && inheritedFound {
+ trans.FmtDateLong = inherited.FmtDateLong
+ }
+
+ if len(trans.FmtDateLong) == 0 && baseFound {
+ trans.FmtDateLong = base.FmtDateLong
+ }
+
+ if len(trans.FmtDateMedium) == 0 && inheritedFound {
+ trans.FmtDateMedium = inherited.FmtDateMedium
+ }
+
+ if len(trans.FmtDateMedium) == 0 && baseFound {
+ trans.FmtDateMedium = base.FmtDateMedium
+ }
+
+ if len(trans.FmtDateShort) == 0 && inheritedFound {
+ trans.FmtDateShort = inherited.FmtDateShort
+ }
+
+ if len(trans.FmtDateShort) == 0 && baseFound {
+ trans.FmtDateShort = base.FmtDateShort
+ }
+
+ // time values
+
+ if len(trans.FmtTimeFull) == 0 && inheritedFound {
+ trans.FmtTimeFull = inherited.FmtTimeFull
+ }
+
+ if len(trans.FmtTimeFull) == 0 && baseFound {
+ trans.FmtTimeFull = base.FmtTimeFull
+ }
+
+ if len(trans.FmtTimeLong) == 0 && inheritedFound {
+ trans.FmtTimeLong = inherited.FmtTimeLong
+ }
+
+ if len(trans.FmtTimeLong) == 0 && baseFound {
+ trans.FmtTimeLong = base.FmtTimeLong
+ }
+
+ if len(trans.FmtTimeMedium) == 0 && inheritedFound {
+ trans.FmtTimeMedium = inherited.FmtTimeMedium
+ }
+
+ if len(trans.FmtTimeMedium) == 0 && baseFound {
+ trans.FmtTimeMedium = base.FmtTimeMedium
+ }
+
+ if len(trans.FmtTimeShort) == 0 && inheritedFound {
+ trans.FmtTimeShort = inherited.FmtTimeShort
+ }
+
+ if len(trans.FmtTimeShort) == 0 && baseFound {
+ trans.FmtTimeShort = base.FmtTimeShort
+ }
+
+ // month values
+
+ if len(trans.FmtMonthsAbbreviated) == 0 && inheritedFound {
+ trans.FmtMonthsAbbreviated = inherited.FmtMonthsAbbreviated
+ }
+
+ if len(trans.FmtMonthsAbbreviated) == 0 && baseFound {
+ trans.FmtMonthsAbbreviated = base.FmtMonthsAbbreviated
+ }
+
+ if len(trans.FmtMonthsNarrow) == 0 && inheritedFound {
+ trans.FmtMonthsNarrow = inherited.FmtMonthsNarrow
+ }
+
+ if len(trans.FmtMonthsNarrow) == 0 && baseFound {
+ trans.FmtMonthsNarrow = base.FmtMonthsNarrow
+ }
+
+ if len(trans.FmtMonthsWide) == 0 && inheritedFound {
+ trans.FmtMonthsWide = inherited.FmtMonthsWide
+ }
+
+ if len(trans.FmtMonthsWide) == 0 && baseFound {
+ trans.FmtMonthsWide = base.FmtMonthsWide
+ }
+
+ // day values
+
+ if len(trans.FmtDaysAbbreviated) == 0 && inheritedFound {
+ trans.FmtDaysAbbreviated = inherited.FmtDaysAbbreviated
+ }
+
+ if len(trans.FmtDaysAbbreviated) == 0 && baseFound {
+ trans.FmtDaysAbbreviated = base.FmtDaysAbbreviated
+ }
+
+ if len(trans.FmtDaysNarrow) == 0 && inheritedFound {
+ trans.FmtDaysNarrow = inherited.FmtDaysNarrow
+ }
+
+ if len(trans.FmtDaysNarrow) == 0 && baseFound {
+ trans.FmtDaysNarrow = base.FmtDaysNarrow
+ }
+
+ if len(trans.FmtDaysShort) == 0 && inheritedFound {
+ trans.FmtDaysShort = inherited.FmtDaysShort
+ }
+
+ if len(trans.FmtDaysShort) == 0 && baseFound {
+ trans.FmtDaysShort = base.FmtDaysShort
+ }
+
+ if len(trans.FmtDaysWide) == 0 && inheritedFound {
+ trans.FmtDaysWide = inherited.FmtDaysWide
+ }
+
+ if len(trans.FmtDaysWide) == 0 && baseFound {
+ trans.FmtDaysWide = base.FmtDaysWide
+ }
+
+ // period values
+
+ if len(trans.FmtPeriodsAbbreviated) == 0 && inheritedFound {
+ trans.FmtPeriodsAbbreviated = inherited.FmtPeriodsAbbreviated
+ }
+
+ if len(trans.FmtPeriodsAbbreviated) == 0 && baseFound {
+ trans.FmtPeriodsAbbreviated = base.FmtPeriodsAbbreviated
+ }
+
+ if len(trans.FmtPeriodsNarrow) == 0 && inheritedFound {
+ trans.FmtPeriodsNarrow = inherited.FmtPeriodsNarrow
+ }
+
+ if len(trans.FmtPeriodsNarrow) == 0 && baseFound {
+ trans.FmtPeriodsNarrow = base.FmtPeriodsNarrow
+ }
+
+ if len(trans.FmtPeriodsShort) == 0 && inheritedFound {
+ trans.FmtPeriodsShort = inherited.FmtPeriodsShort
+ }
+
+ if len(trans.FmtPeriodsShort) == 0 && baseFound {
+ trans.FmtPeriodsShort = base.FmtPeriodsShort
+ }
+
+ if len(trans.FmtPeriodsWide) == 0 && inheritedFound {
+ trans.FmtPeriodsWide = inherited.FmtPeriodsWide
+ }
+
+ if len(trans.FmtPeriodsWide) == 0 && baseFound {
+ trans.FmtPeriodsWide = base.FmtPeriodsWide
+ }
+
+ // era values
+
+ if len(trans.FmtErasAbbreviated) == 0 && inheritedFound {
+ trans.FmtErasAbbreviated = inherited.FmtErasAbbreviated
+ }
+
+ if len(trans.FmtErasAbbreviated) == 0 && baseFound {
+ trans.FmtErasAbbreviated = base.FmtErasAbbreviated
+ }
+
+ if len(trans.FmtErasNarrow) == 0 && inheritedFound {
+ trans.FmtErasNarrow = inherited.FmtErasNarrow
+ }
+
+ if len(trans.FmtErasNarrow) == 0 && baseFound {
+ trans.FmtErasNarrow = base.FmtErasNarrow
+ }
+
+ if len(trans.FmtErasWide) == 0 && inheritedFound {
+ trans.FmtErasWide = inherited.FmtErasWide
+ }
+
+ if len(trans.FmtErasWide) == 0 && baseFound {
+ trans.FmtErasWide = base.FmtErasWide
+ }
+
+ ldml := cldr.RawLDML(trans.Locale)
+
+ currencies := make([]string, len(globalCurrencies), len(globalCurrencies))
+
+ var kval string
+
+ for k, v := range globCurrencyIdxMap {
+
+ kval = k
+ // if kval[:len(kval)-1] != " " {
+ // kval += " "
+ // }
+
+ currencies[v] = kval
+ }
+
+ // some just have no data...
+ if ldml.Numbers != nil {
+
+ if ldml.Numbers.Currencies != nil {
+ for _, currency := range ldml.Numbers.Currencies.Currency {
+
+ if len(currency.Symbol) == 0 {
+ continue
+ }
+
+ if len(currency.Symbol[0].Data()) == 0 {
+ continue
+ }
+
+ if len(currency.Type) == 0 {
+ continue
+ }
+
+ currencies[globCurrencyIdxMap[currency.Type]] = currency.Symbol[0].Data()
+ }
+ }
+ }
+
+ trans.Currencies = fmt.Sprintf("%#v", currencies)
+
+ // timezones
+
+ if (trans.timezones == nil || len(trans.timezones) == 0) && inheritedFound {
+ trans.timezones = inherited.timezones
+ }
+
+ if (trans.timezones == nil || len(trans.timezones) == 0) && baseFound {
+ trans.timezones = base.timezones
+ }
+
+ // make sure all inherited timezones are part of sub locale timezones
+ if inheritedFound {
+
+ var ok bool
+
+ for k, v := range inherited.timezones {
+
+ if _, ok = trans.timezones[k]; ok {
+ continue
+ }
+
+ trans.timezones[k] = v
+ }
+ }
+
+ // make sure all base timezones are part of sub locale timezones
+ if baseFound {
+
+ var ok bool
+
+ for k, v := range base.timezones {
+
+ if _, ok = trans.timezones[k]; ok {
+ continue
+ }
+
+ trans.timezones[k] = v
+ }
+ }
+
+ applyOverrides(trans)
+
+ parseDecimalNumberFormat(trans)
+ parsePercentNumberFormat(trans)
+ parseCurrencyNumberFormat(trans)
+ }
+
+ for _, trans := range translators {
+
+ fmt.Println("Final Processing:", trans.Locale)
+
+ // if it's still nill.....
+ if trans.timezones == nil {
+ trans.timezones = make(map[string]*zoneAbbrev)
+ }
+
+ tz := make(map[string]string) // key = abbrev locale eg. EST, EDT, MST, PST... value = long locale eg. Eastern Standard Time, Pacific Time.....
+
+ for k, v := range timezones {
+
+ ttz, ok := trans.timezones[k]
+ if !ok {
+ ttz = v
+ trans.timezones[k] = v
+ }
+
+ tz[v.standard] = ttz.standard
+ tz[v.daylight] = ttz.daylight
+ }
+
+ trans.FmtTimezones = fmt.Sprintf("%#v", tz)
+
+ if len(trans.TimeSeparator) == 0 {
+ trans.TimeSeparator = ":"
+ }
+
+ trans.FmtDateShort, trans.FmtDateMedium, trans.FmtDateLong, trans.FmtDateFull = parseDateFormats(trans, trans.FmtDateShort, trans.FmtDateMedium, trans.FmtDateLong, trans.FmtDateFull)
+ trans.FmtTimeShort, trans.FmtTimeMedium, trans.FmtTimeLong, trans.FmtTimeFull = parseDateFormats(trans, trans.FmtTimeShort, trans.FmtTimeMedium, trans.FmtTimeLong, trans.FmtTimeFull)
+ }
+}
+
+// preprocesses maps, array etc... just requires multiple passes no choice....
+func preProcess(cldrVar *cldr.CLDR) {
+
+ for _, l := range cldrVar.Locales() {
+
+ fmt.Println("Pre Processing:", l)
+
+ split := strings.SplitN(l, "_", 2)
+ baseLocale := split[0]
+ // inheritedLocale := baseLocale
+
+ // // one of the inherited english locales
+ // // http://cldr.unicode.org/development/development-process/design-proposals/english-inheritance
+ // if l == "en_001" || l == "en_GB" {
+ // inheritedLocale = l
+ // }
+
+ trans := &translator{
+ Locale: l,
+ BaseLocale: baseLocale,
+ // InheritedLocale: inheritedLocale,
+ }
+
+ // if is a base locale
+ if len(split) == 1 {
+ baseTranslators[baseLocale] = trans
+ }
+
+ // baseTranslators[l] = trans
+ // baseTranslators[baseLocale] = trans // allowing for unofficial fallback if none exists
+ translators[l] = trans
+
+ // get number, currency and datetime symbols
+
+ // number values
+ ldml := cldrVar.RawLDML(l)
+
+ // some just have no data...
+ if ldml.Numbers != nil {
+
+ if len(ldml.Numbers.Symbols) > 0 {
+
+ symbol := ldml.Numbers.Symbols[0]
+
+ // Try to get the default numbering system instead of the first one
+ systems := ldml.Numbers.DefaultNumberingSystem
+ // There shouldn't really be more than one DefaultNumberingSystem
+ if len(systems) > 0 {
+ if dns := systems[0].Data(); dns != "" {
+ for k := range ldml.Numbers.Symbols {
+ if ldml.Numbers.Symbols[k].NumberSystem == dns {
+ symbol = ldml.Numbers.Symbols[k]
+ break
+ }
+ }
+ }
+ }
+
+ if len(symbol.Decimal) > 0 {
+ trans.Decimal = symbol.Decimal[0].Data()
+ }
+ if len(symbol.Group) > 0 {
+ trans.Group = symbol.Group[0].Data()
+ }
+ if len(symbol.MinusSign) > 0 {
+ trans.Minus = symbol.MinusSign[0].Data()
+ }
+ if len(symbol.PercentSign) > 0 {
+ trans.Percent = symbol.PercentSign[0].Data()
+ }
+ if len(symbol.PerMille) > 0 {
+ trans.PerMille = symbol.PerMille[0].Data()
+ }
+
+ if len(symbol.TimeSeparator) > 0 {
+ trans.TimeSeparator = symbol.TimeSeparator[0].Data()
+ }
+
+ if len(symbol.Infinity) > 0 {
+ trans.Infinity = symbol.Infinity[0].Data()
+ }
+ }
+
+ if ldml.Numbers.Currencies != nil {
+
+ for _, currency := range ldml.Numbers.Currencies.Currency {
+
+ if len(strings.TrimSpace(currency.Type)) == 0 {
+ continue
+ }
+
+ globalCurrenciesMap[currency.Type] = struct{}{}
+ }
+ }
+
+ if len(ldml.Numbers.DecimalFormats) > 0 && len(ldml.Numbers.DecimalFormats[0].DecimalFormatLength) > 0 {
+
+ for _, dfl := range ldml.Numbers.DecimalFormats[0].DecimalFormatLength {
+ if len(dfl.Type) == 0 {
+ trans.DecimalNumberFormat = dfl.DecimalFormat[0].Pattern[0].Data()
+ break
+ }
+ }
+ }
+
+ if len(ldml.Numbers.PercentFormats) > 0 && len(ldml.Numbers.PercentFormats[0].PercentFormatLength) > 0 {
+
+ for _, dfl := range ldml.Numbers.PercentFormats[0].PercentFormatLength {
+ if len(dfl.Type) == 0 {
+ trans.PercentNumberFormat = dfl.PercentFormat[0].Pattern[0].Data()
+ break
+ }
+ }
+ }
+
+ if len(ldml.Numbers.CurrencyFormats) > 0 && len(ldml.Numbers.CurrencyFormats[0].CurrencyFormatLength) > 0 {
+
+ if len(ldml.Numbers.CurrencyFormats[0].CurrencyFormatLength[0].CurrencyFormat) > 1 {
+
+ split := strings.SplitN(ldml.Numbers.CurrencyFormats[0].CurrencyFormatLength[0].CurrencyFormat[1].Pattern[0].Data(), ";", 2)
+
+ trans.CurrencyNumberFormat = split[0]
+
+ if len(split) > 1 && len(split[1]) > 0 {
+ trans.NegativeCurrencyNumberFormat = split[1]
+ } else {
+ trans.NegativeCurrencyNumberFormat = trans.CurrencyNumberFormat
+ }
+ } else {
+ trans.CurrencyNumberFormat = ldml.Numbers.CurrencyFormats[0].CurrencyFormatLength[0].CurrencyFormat[0].Pattern[0].Data()
+ trans.NegativeCurrencyNumberFormat = trans.CurrencyNumberFormat
+ }
+ }
+ }
+
+ if ldml.Dates != nil {
+
+ if ldml.Dates.TimeZoneNames != nil {
+
+ for _, zone := range ldml.Dates.TimeZoneNames.Metazone {
+
+ for _, short := range zone.Short {
+
+ if len(short.Standard) > 0 {
+ za, ok := timezones[zone.Type]
+ if !ok {
+ za = new(zoneAbbrev)
+ timezones[zone.Type] = za
+ }
+ za.standard = short.Standard[0].Data()
+ }
+
+ if len(short.Daylight) > 0 {
+ za, ok := timezones[zone.Type]
+ if !ok {
+ za = new(zoneAbbrev)
+ timezones[zone.Type] = za
+ }
+ za.daylight = short.Daylight[0].Data()
+ }
+ }
+
+ for _, long := range zone.Long {
+
+ if trans.timezones == nil {
+ trans.timezones = make(map[string]*zoneAbbrev)
+ }
+
+ if len(long.Standard) > 0 {
+ za, ok := trans.timezones[zone.Type]
+ if !ok {
+ za = new(zoneAbbrev)
+ trans.timezones[zone.Type] = za
+ }
+ za.standard = long.Standard[0].Data()
+ }
+
+ za, ok := trans.timezones[zone.Type]
+ if !ok {
+ za = new(zoneAbbrev)
+ trans.timezones[zone.Type] = za
+ }
+
+ if len(long.Daylight) > 0 {
+ za.daylight = long.Daylight[0].Data()
+ } else {
+ za.daylight = za.standard
+ }
+ }
+ }
+ }
+
+ if ldml.Dates.Calendars != nil {
+
+ var calendar *cldr.Calendar
+
+ for _, cal := range ldml.Dates.Calendars.Calendar {
+ if cal.Type == "gregorian" {
+ calendar = cal
+ }
+ }
+
+ if calendar != nil {
+
+ if calendar.DateFormats != nil {
+
+ for _, datefmt := range calendar.DateFormats.DateFormatLength {
+
+ switch datefmt.Type {
+ case "full":
+ trans.FmtDateFull = datefmt.DateFormat[0].Pattern[0].Data()
+
+ case "long":
+ trans.FmtDateLong = datefmt.DateFormat[0].Pattern[0].Data()
+
+ case "medium":
+ trans.FmtDateMedium = datefmt.DateFormat[0].Pattern[0].Data()
+
+ case "short":
+ trans.FmtDateShort = datefmt.DateFormat[0].Pattern[0].Data()
+ }
+ }
+ }
+
+ if calendar.TimeFormats != nil {
+
+ for _, datefmt := range calendar.TimeFormats.TimeFormatLength {
+
+ switch datefmt.Type {
+ case "full":
+ trans.FmtTimeFull = datefmt.TimeFormat[0].Pattern[0].Data()
+ case "long":
+ trans.FmtTimeLong = datefmt.TimeFormat[0].Pattern[0].Data()
+ case "medium":
+ trans.FmtTimeMedium = datefmt.TimeFormat[0].Pattern[0].Data()
+ case "short":
+ trans.FmtTimeShort = datefmt.TimeFormat[0].Pattern[0].Data()
+ }
+ }
+ }
+
+ if calendar.Months != nil {
+
+ // month context starts at 'format', but there is also has 'stand-alone'
+ // I'm making the decision to use the 'stand-alone' if, and only if,
+ // the value does not exist in the 'format' month context
+ var abbrSet, narrSet, wideSet bool
+
+ for _, monthctx := range calendar.Months.MonthContext {
+
+ for _, months := range monthctx.MonthWidth {
+
+ var monthData []string
+
+ for _, m := range months.Month {
+
+ if len(m.Data()) == 0 {
+ continue
+ }
+
+ switch m.Type {
+ case "1":
+ monthData = append(monthData, m.Data())
+ case "2":
+ monthData = append(monthData, m.Data())
+ case "3":
+ monthData = append(monthData, m.Data())
+ case "4":
+ monthData = append(monthData, m.Data())
+ case "5":
+ monthData = append(monthData, m.Data())
+ case "6":
+ monthData = append(monthData, m.Data())
+ case "7":
+ monthData = append(monthData, m.Data())
+ case "8":
+ monthData = append(monthData, m.Data())
+ case "9":
+ monthData = append(monthData, m.Data())
+ case "10":
+ monthData = append(monthData, m.Data())
+ case "11":
+ monthData = append(monthData, m.Data())
+ case "12":
+ monthData = append(monthData, m.Data())
+ }
+ }
+
+ if len(monthData) > 0 {
+
+ // making array indexes line up with month values
+ // so I'll have an extra empty value, it's way faster
+ // than a switch over all type values...
+ monthData = append(make([]string, 1, len(monthData)+1), monthData...)
+
+ switch months.Type {
+ case "abbreviated":
+ if !abbrSet {
+ abbrSet = true
+ trans.FmtMonthsAbbreviated = fmt.Sprintf("%#v", monthData)
+ }
+ case "narrow":
+ if !narrSet {
+ narrSet = true
+ trans.FmtMonthsNarrow = fmt.Sprintf("%#v", monthData)
+ }
+ case "wide":
+ if !wideSet {
+ wideSet = true
+ trans.FmtMonthsWide = fmt.Sprintf("%#v", monthData)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if calendar.Days != nil {
+
+ // day context starts at 'format', but there is also has 'stand-alone'
+ // I'm making the decision to use the 'stand-alone' if, and only if,
+ // the value does not exist in the 'format' day context
+ var abbrSet, narrSet, shortSet, wideSet bool
+
+ for _, dayctx := range calendar.Days.DayContext {
+
+ for _, days := range dayctx.DayWidth {
+
+ var dayData []string
+
+ for _, d := range days.Day {
+
+ switch d.Type {
+ case "sun":
+ dayData = append(dayData, d.Data())
+ case "mon":
+ dayData = append(dayData, d.Data())
+ case "tue":
+ dayData = append(dayData, d.Data())
+ case "wed":
+ dayData = append(dayData, d.Data())
+ case "thu":
+ dayData = append(dayData, d.Data())
+ case "fri":
+ dayData = append(dayData, d.Data())
+ case "sat":
+ dayData = append(dayData, d.Data())
+ }
+ }
+
+ if len(dayData) > 0 {
+ switch days.Type {
+ case "abbreviated":
+ if !abbrSet {
+ abbrSet = true
+ trans.FmtDaysAbbreviated = fmt.Sprintf("%#v", dayData)
+ }
+ case "narrow":
+ if !narrSet {
+ narrSet = true
+ trans.FmtDaysNarrow = fmt.Sprintf("%#v", dayData)
+ }
+ case "short":
+ if !shortSet {
+ shortSet = true
+ trans.FmtDaysShort = fmt.Sprintf("%#v", dayData)
+ }
+ case "wide":
+ if !wideSet {
+ wideSet = true
+ trans.FmtDaysWide = fmt.Sprintf("%#v", dayData)
+ }
+ }
+ }
+ }
+ }
+ }
+
+ if calendar.DayPeriods != nil {
+
+ // day periods context starts at 'format', but there is also has 'stand-alone'
+ // I'm making the decision to use the 'stand-alone' if, and only if,
+ // the value does not exist in the 'format' day period context
+ var abbrSet, narrSet, shortSet, wideSet bool
+
+ for _, ctx := range calendar.DayPeriods.DayPeriodContext {
+
+ for _, width := range ctx.DayPeriodWidth {
+
+ // [0] = AM
+ // [0] = PM
+ ampm := make([]string, 2, 2)
+
+ for _, d := range width.DayPeriod {
+
+ if d.Type == "am" {
+ ampm[0] = d.Data()
+ continue
+ }
+
+ if d.Type == "pm" {
+ ampm[1] = d.Data()
+ }
+ }
+
+ switch width.Type {
+ case "abbreviated":
+ if !abbrSet {
+ abbrSet = true
+ trans.FmtPeriodsAbbreviated = fmt.Sprintf("%#v", ampm)
+ }
+ case "narrow":
+ if !narrSet {
+ narrSet = true
+ trans.FmtPeriodsNarrow = fmt.Sprintf("%#v", ampm)
+ }
+ case "short":
+ if !shortSet {
+ shortSet = true
+ trans.FmtPeriodsShort = fmt.Sprintf("%#v", ampm)
+ }
+ case "wide":
+ if !wideSet {
+ wideSet = true
+ trans.FmtPeriodsWide = fmt.Sprintf("%#v", ampm)
+ }
+ }
+ }
+ }
+ }
+
+ if calendar.Eras != nil {
+
+ // [0] = BC
+ // [0] = AD
+ abbrev := make([]string, 2, 2)
+ narr := make([]string, 2, 2)
+ wide := make([]string, 2, 2)
+
+ if calendar.Eras.EraAbbr != nil {
+
+ if len(calendar.Eras.EraAbbr.Era) == 4 {
+ abbrev[0] = calendar.Eras.EraAbbr.Era[0].Data()
+ abbrev[1] = calendar.Eras.EraAbbr.Era[2].Data()
+ } else if len(calendar.Eras.EraAbbr.Era) == 2 {
+ abbrev[0] = calendar.Eras.EraAbbr.Era[0].Data()
+ abbrev[1] = calendar.Eras.EraAbbr.Era[1].Data()
+ }
+ }
+
+ if calendar.Eras.EraNarrow != nil {
+
+ if len(calendar.Eras.EraNarrow.Era) == 4 {
+ narr[0] = calendar.Eras.EraNarrow.Era[0].Data()
+ narr[1] = calendar.Eras.EraNarrow.Era[2].Data()
+ } else if len(calendar.Eras.EraNarrow.Era) == 2 {
+ narr[0] = calendar.Eras.EraNarrow.Era[0].Data()
+ narr[1] = calendar.Eras.EraNarrow.Era[1].Data()
+ }
+ }
+
+ if calendar.Eras.EraNames != nil {
+
+ if len(calendar.Eras.EraNames.Era) == 4 {
+ wide[0] = calendar.Eras.EraNames.Era[0].Data()
+ wide[1] = calendar.Eras.EraNames.Era[2].Data()
+ } else if len(calendar.Eras.EraNames.Era) == 2 {
+ wide[0] = calendar.Eras.EraNames.Era[0].Data()
+ wide[1] = calendar.Eras.EraNames.Era[1].Data()
+ }
+ }
+
+ trans.FmtErasAbbreviated = fmt.Sprintf("%#v", abbrev)
+ trans.FmtErasNarrow = fmt.Sprintf("%#v", narr)
+ trans.FmtErasWide = fmt.Sprintf("%#v", wide)
+ }
+ }
+ }
+ }
+ }
+
+ for k := range globalCurrenciesMap {
+ globalCurrencies = append(globalCurrencies, k)
+ }
+
+ sort.Strings(globalCurrencies)
+
+ for i, loc := range globalCurrencies {
+ globCurrencyIdxMap[loc] = i
+ }
+}
+
+func parseDateFormats(trans *translator, shortFormat, mediumFormat, longFormat, fullFormat string) (short, medium, long, full string) {
+
+ // Short Date Parsing
+
+ short = parseDateTimeFormat(trans.BaseLocale, shortFormat, 2)
+ medium = parseDateTimeFormat(trans.BaseLocale, mediumFormat, 2)
+ long = parseDateTimeFormat(trans.BaseLocale, longFormat, 1)
+ full = parseDateTimeFormat(trans.BaseLocale, fullFormat, 0)
+
+ // End Short Data Parsing
+
+ return
+}
+
+func parseDateTimeFormat(baseLocale, format string, eraScore uint8) (results string) {
+
+ // rules:
+ // y = four digit year
+ // yy = two digit year
+
+ // var b []byte
+
+ var inConstantText bool
+ var start int
+
+ for i := 0; i < len(format); i++ {
+
+ switch format[i] {
+
+ // time separator
+ case ':':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ results += "b = append(b, " + baseLocale + ".timeSeparator...)"
+ case '\'':
+
+ i++
+ startI := i
+
+ // peek to see if ''
+ if len(format) != i && format[i] == '\'' {
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i-1])) + "...)\n"
+ } else {
+ inConstantText = true
+ start = i
+ }
+
+ continue
+ }
+
+ // not '' so whatever comes between '' is constant
+
+ if len(format) != i {
+
+ // advance i to the next single quote + 1
+ for ; i < len(format); i++ {
+ if format[i] == '\'' {
+
+ if inConstantText {
+ inConstantText = false
+ b := []byte(format[start : startI-1])
+ b = append(b, []byte(format[startI:i])...)
+
+ results += "b = append(b, " + fmt.Sprintf("%#v", b) + "...)\n"
+
+ } else {
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[startI:i])) + "...)\n"
+ }
+
+ break
+ }
+ }
+ }
+
+ // 24 hour
+ case 'H':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // peek
+ // two digit hour required?
+ if len(format) != i+1 && format[i+1] == 'H' {
+ i++
+ results += `
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ `
+ }
+
+ results += "b = strconv.AppendInt(b, int64(t.Hour()), 10)\n"
+
+ // hour
+ case 'h':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ results += `
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ `
+
+ // peek
+ // two digit hour required?
+ if len(format) != i+1 && format[i+1] == 'h' {
+ i++
+ results += `
+ if h < 10 {
+ b = append(b, '0')
+ }
+
+ `
+ }
+
+ results += "b = strconv.AppendInt(b, int64(h), 10)\n"
+
+ // minute
+ case 'm':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // peek
+ // two digit minute required?
+ if len(format) != i+1 && format[i+1] == 'm' {
+ i++
+ results += `
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ `
+ }
+
+ results += "b = strconv.AppendInt(b, int64(t.Minute()), 10)\n"
+
+ // second
+ case 's':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // peek
+ // two digit minute required?
+ if len(format) != i+1 && format[i+1] == 's' {
+ i++
+ results += `
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ `
+ }
+
+ results += "b = strconv.AppendInt(b, int64(t.Second()), 10)\n"
+
+ // day period
+ case 'a':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // only used with 'h', patterns should not contains 'a' without 'h' so not checking
+
+ // choosing to use abbreviated, didn't see any rules about which should be used with which
+ // date format....
+
+ results += `
+
+ if t.Hour() < 12 {
+ b = append(b, ` + baseLocale + `.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ` + baseLocale + `.periodsAbbreviated[1]...)
+ }
+
+ `
+
+ // timezone
+ case 'z', 'v':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // consume multiple, only handling Abbrev tz from time.Time for the moment...
+
+ var count int
+
+ if format[i] == 'z' {
+ for j := i; j < len(format); j++ {
+ if format[j] == 'z' {
+ count++
+ } else {
+ break
+ }
+ }
+ }
+
+ if format[i] == 'v' {
+ for j := i; j < len(format); j++ {
+ if format[j] == 'v' {
+ count++
+ } else {
+ break
+ }
+ }
+ }
+
+ i += count - 1
+
+ // using the timezone on the Go time object, eg. EST, EDT, MST.....
+
+ if count < 4 {
+
+ results += `
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ `
+ } else {
+
+ results += `
+ tz, _ := t.Zone()
+
+ if btz, ok := ` + baseLocale + `.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ `
+ }
+
+ // day
+ case 'd':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // peek
+ // two digit day required?
+ if len(format) != i+1 && format[i+1] == 'd' {
+ i++
+ results += `
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ `
+ }
+
+ results += "b = strconv.AppendInt(b, int64(t.Day()), 10)\n"
+
+ // month
+ case 'M':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ var count int
+
+ // count # of M's
+ for j := i; j < len(format); j++ {
+ if format[j] == 'M' {
+ count++
+ } else {
+ break
+ }
+ }
+
+ switch count {
+
+ // Numeric form, at least 1 digit
+ case 1:
+
+ results += "b = strconv.AppendInt(b, int64(t.Month()), 10)\n"
+
+ // Number form, at least 2 digits (padding with 0)
+ case 2:
+
+ results += `
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ `
+
+ // Abbreviated form
+ case 3:
+
+ results += "b = append(b, " + baseLocale + ".monthsAbbreviated[t.Month()]...)\n"
+
+ // Full/Wide form
+ case 4:
+
+ results += "b = append(b, " + baseLocale + ".monthsWide[t.Month()]...)\n"
+
+ // Narrow form - only used in where context makes it clear, such as headers in a calendar.
+ // Should be one character wherever possible.
+ case 5:
+
+ results += "b = append(b, " + baseLocale + ".monthsNarrow[t.Month()]...)\n"
+ }
+
+ // skip over M's
+ i += count - 1
+
+ // year
+ case 'y':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ // peek
+ // two digit year
+ if len(format) != i+1 && format[i+1] == 'y' {
+ i++
+ results += `
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ `
+ } else {
+ // four digit year
+ results += `
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ `
+ }
+
+ // weekday
+ // I know I only see 'EEEE' in the xml, but just in case handled all posibilities
+ case 'E':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ var count int
+
+ // count # of E's
+ for j := i; j < len(format); j++ {
+ if format[j] == 'E' {
+ count++
+ } else {
+ break
+ }
+ }
+
+ switch count {
+
+ // Narrow
+ case 1:
+
+ results += "b = append(b, " + baseLocale + ".daysNarrow[t.Weekday()]...)\n"
+
+ // Short
+ case 2:
+
+ results += "b = append(b, " + baseLocale + ".daysShort[t.Weekday()]...)\n"
+
+ // Abbreviated
+ case 3:
+
+ results += "b = append(b, " + baseLocale + ".daysAbbreviated[t.Weekday()]...)\n"
+
+ // Full/Wide
+ case 4:
+
+ results += "b = append(b, " + baseLocale + ".daysWide[t.Weekday()]...)\n"
+ }
+
+ // skip over E's
+ i += count - 1
+
+ // era eg. AD, BC
+ case 'G':
+
+ if inConstantText {
+ inConstantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:i])) + "...)\n"
+ }
+
+ switch eraScore {
+ case 0:
+ results += `
+
+ if t.Year() < 0 {
+ b = append(b, ` + baseLocale + `.erasWide[0]...)
+ } else {
+ b = append(b, ` + baseLocale + `.erasWide[1]...)
+ }
+
+ `
+ case 1, 2:
+ results += `
+
+ if t.Year() < 0 {
+ b = append(b, ` + baseLocale + `.erasAbbreviated[0]...)
+ } else {
+ b = append(b, ` + baseLocale + `.erasAbbreviated[1]...)
+ }
+
+ `
+ }
+
+ default:
+ // append all non matched text as they are constants
+ if !inConstantText {
+ inConstantText = true
+ start = i
+ }
+ }
+ }
+
+ // if we were inConstantText when the string ended, add what's left.
+ if inConstantText {
+ // inContantText = false
+ results += "b = append(b, " + fmt.Sprintf("%#v", []byte(format[start:])) + "...)\n"
+ }
+
+ return
+}
+
+func parseCurrencyNumberFormat(trans *translator) {
+
+ if len(trans.CurrencyNumberFormat) == 0 {
+ return
+ }
+
+ trans.FmtCurrencyExists = true
+ negativeEqual := trans.CurrencyNumberFormat == trans.NegativeCurrencyNumberFormat
+
+ match := groupLenRegex.FindString(trans.CurrencyNumberFormat)
+ if len(match) > 0 {
+ trans.FmtCurrencyGroupLen = len(match) - 2
+ }
+
+ match = requiredDecimalRegex.FindString(trans.CurrencyNumberFormat)
+ if len(match) > 0 {
+ trans.FmtCurrencyMinDecimalLen = len(match) - 1
+ }
+
+ match = secondaryGroupLenRegex.FindString(trans.CurrencyNumberFormat)
+ if len(match) > 0 {
+ trans.FmtCurrencySecondaryGroupLen = len(match) - 2
+ }
+
+ idx := 0
+
+ for idx = 0; idx < len(trans.CurrencyNumberFormat); idx++ {
+ if trans.CurrencyNumberFormat[idx] == '#' || trans.CurrencyNumberFormat[idx] == '0' {
+ trans.FmtCurrencyPrefix = trans.CurrencyNumberFormat[:idx]
+ break
+ }
+ }
+
+ for idx = len(trans.CurrencyNumberFormat) - 1; idx >= 0; idx-- {
+ if trans.CurrencyNumberFormat[idx] == '#' || trans.CurrencyNumberFormat[idx] == '0' {
+ idx++
+ trans.FmtCurrencySuffix = trans.CurrencyNumberFormat[idx:]
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtCurrencyPrefix); idx++ {
+ if trans.FmtCurrencyPrefix[idx] == '¤' {
+
+ trans.FmtCurrencyInPrefix = true
+ trans.FmtCurrencyPrefix = strings.Replace(trans.FmtCurrencyPrefix, string(trans.FmtCurrencyPrefix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtCurrencyLeft = true
+ } else {
+ trans.FmtCurrencyLeft = false
+ }
+
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtCurrencySuffix); idx++ {
+ if trans.FmtCurrencySuffix[idx] == '¤' {
+
+ trans.FmtCurrencyInPrefix = false
+ trans.FmtCurrencySuffix = strings.Replace(trans.FmtCurrencySuffix, string(trans.FmtCurrencySuffix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtCurrencyLeft = true
+ } else {
+ trans.FmtCurrencyLeft = false
+ }
+
+ break
+ }
+ }
+
+ // if len(trans.FmtCurrencyPrefix) > 0 {
+ // trans.FmtCurrencyPrefix = fmt.Sprintf("%#v", []byte(trans.FmtCurrencyPrefix))
+ // }
+
+ // if len(trans.FmtCurrencySuffix) > 0 {
+ // trans.FmtCurrencySuffix = fmt.Sprintf("%#v", []byte(trans.FmtCurrencySuffix))
+ // }
+
+ // no need to parse again if true....
+ if negativeEqual {
+
+ trans.FmtCurrencyNegativePrefix = trans.FmtCurrencyPrefix
+ trans.FmtCurrencyNegativeSuffix = trans.FmtCurrencySuffix
+ trans.FmtCurrencyNegativeInPrefix = trans.FmtCurrencyInPrefix
+ trans.FmtCurrencyNegativeLeft = trans.FmtCurrencyLeft
+
+ return
+ }
+
+ trans.FmtCurrencyNegativeExists = true
+
+ for idx = 0; idx < len(trans.NegativeCurrencyNumberFormat); idx++ {
+ if trans.NegativeCurrencyNumberFormat[idx] == '#' || trans.NegativeCurrencyNumberFormat[idx] == '0' {
+
+ trans.FmtCurrencyNegativePrefix = trans.NegativeCurrencyNumberFormat[:idx]
+ break
+ }
+ }
+
+ for idx = len(trans.NegativeCurrencyNumberFormat) - 1; idx >= 0; idx-- {
+ if trans.NegativeCurrencyNumberFormat[idx] == '#' || trans.NegativeCurrencyNumberFormat[idx] == '0' {
+ idx++
+ trans.FmtCurrencyNegativeSuffix = trans.NegativeCurrencyNumberFormat[idx:]
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtCurrencyNegativePrefix); idx++ {
+ if trans.FmtCurrencyNegativePrefix[idx] == '¤' {
+
+ trans.FmtCurrencyNegativeInPrefix = true
+ trans.FmtCurrencyNegativePrefix = strings.Replace(trans.FmtCurrencyNegativePrefix, string(trans.FmtCurrencyNegativePrefix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtCurrencyNegativeLeft = true
+ } else {
+ trans.FmtCurrencyNegativeLeft = false
+ }
+
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtCurrencyNegativeSuffix); idx++ {
+ if trans.FmtCurrencyNegativeSuffix[idx] == '¤' {
+
+ trans.FmtCurrencyNegativeInPrefix = false
+ trans.FmtCurrencyNegativeSuffix = strings.Replace(trans.FmtCurrencyNegativeSuffix, string(trans.FmtCurrencyNegativeSuffix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtCurrencyNegativeLeft = true
+ } else {
+ trans.FmtCurrencyNegativeLeft = false
+ }
+
+ break
+ }
+ }
+
+ // if len(trans.FmtCurrencyNegativePrefix) > 0 {
+ // trans.FmtCurrencyNegativePrefix = fmt.Sprintf("%#v", []byte(trans.FmtCurrencyNegativePrefix))
+ // }
+
+ // if len(trans.FmtCurrencyNegativeSuffix) > 0 {
+ // trans.FmtCurrencyNegativeSuffix = fmt.Sprintf("%#v", []byte(trans.FmtCurrencyNegativeSuffix))
+ // }
+
+ return
+}
+
+func parsePercentNumberFormat(trans *translator) {
+
+ if len(trans.PercentNumberFormat) == 0 {
+ return
+ }
+
+ trans.FmtPercentExists = true
+
+ match := groupLenPercentRegex.FindString(trans.PercentNumberFormat)
+ if len(match) > 0 {
+ trans.FmtPercentGroupLen = len(match) - 1
+ }
+
+ match = requiredDecimalRegex.FindString(trans.PercentNumberFormat)
+ if len(match) > 0 {
+ trans.FmtPercentMinDecimalLen = len(match) - 1
+ }
+
+ match = secondaryGroupLenRegex.FindString(trans.PercentNumberFormat)
+ if len(match) > 0 {
+ trans.FmtPercentSecondaryGroupLen = len(match) - 2
+ }
+
+ idx := 0
+
+ for idx = 0; idx < len(trans.PercentNumberFormat); idx++ {
+ if trans.PercentNumberFormat[idx] == '#' || trans.PercentNumberFormat[idx] == '0' {
+ trans.FmtPercentPrefix = trans.PercentNumberFormat[:idx]
+ break
+ }
+ }
+
+ for idx = len(trans.PercentNumberFormat) - 1; idx >= 0; idx-- {
+ if trans.PercentNumberFormat[idx] == '#' || trans.PercentNumberFormat[idx] == '0' {
+ idx++
+ trans.FmtPercentSuffix = trans.PercentNumberFormat[idx:]
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtPercentPrefix); idx++ {
+ if trans.FmtPercentPrefix[idx] == '%' {
+
+ trans.FmtPercentInPrefix = true
+ trans.FmtPercentPrefix = strings.Replace(trans.FmtPercentPrefix, string(trans.FmtPercentPrefix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtPercentLeft = true
+ } else {
+ trans.FmtPercentLeft = false
+ }
+
+ break
+ }
+ }
+
+ for idx = 0; idx < len(trans.FmtPercentSuffix); idx++ {
+ if trans.FmtPercentSuffix[idx] == '%' {
+
+ trans.FmtPercentInPrefix = false
+ trans.FmtPercentSuffix = strings.Replace(trans.FmtPercentSuffix, string(trans.FmtPercentSuffix[idx]), "", 1)
+
+ if idx == 0 {
+ trans.FmtPercentLeft = true
+ } else {
+ trans.FmtPercentLeft = false
+ }
+
+ break
+ }
+ }
+
+ // if len(trans.FmtPercentPrefix) > 0 {
+ // trans.FmtPercentPrefix = fmt.Sprintf("%#v", []byte(trans.FmtPercentPrefix))
+ // }
+
+ // if len(trans.FmtPercentSuffix) > 0 {
+ // trans.FmtPercentSuffix = fmt.Sprintf("%#v", []byte(trans.FmtPercentSuffix))
+ // }
+
+ return
+}
+
+func parseDecimalNumberFormat(trans *translator) {
+
+ if len(trans.DecimalNumberFormat) == 0 {
+ return
+ }
+
+ trans.FmtNumberExists = true
+
+ formats := strings.SplitN(trans.DecimalNumberFormat, ";", 2)
+
+ match := groupLenRegex.FindString(formats[0])
+ if len(match) > 0 {
+ trans.FmtNumberGroupLen = len(match) - 2
+ }
+
+ match = requiredDecimalRegex.FindString(formats[0])
+ if len(match) > 0 {
+ trans.FmtNumberMinDecimalLen = len(match) - 1
+ }
+
+ match = secondaryGroupLenRegex.FindString(formats[0])
+ if len(match) > 0 {
+ trans.FmtNumberSecondaryGroupLen = len(match) - 2
+ }
+
+ return
+}
+
+type sortRank struct {
+ Rank uint8
+ Value string
+}
+
+type ByRank []sortRank
+
+func (a ByRank) Len() int { return len(a) }
+func (a ByRank) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a ByRank) Less(i, j int) bool { return a[i].Rank < a[j].Rank }
+
+type ByPluralRule []locales.PluralRule
+
+func (a ByPluralRule) Len() int { return len(a) }
+func (a ByPluralRule) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
+func (a ByPluralRule) Less(i, j int) bool { return a[i] < a[j] }
+
+// TODO: refine generated code a bit, some combinations end up with same plural rule,
+// could check all at once; but it works and that's step 1 complete
+func parseRangePluralRuleFunc(current *cldr.CLDR, baseLocale string) (results string, plurals string) {
+
+ var pluralRange *struct {
+ cldr.Common
+ Locales string `xml:"locales,attr"`
+ PluralRange []*struct {
+ cldr.Common
+ Start string `xml:"start,attr"`
+ End string `xml:"end,attr"`
+ Result string `xml:"result,attr"`
+ } `xml:"pluralRange"`
+ }
+
+ var pluralArr []locales.PluralRule
+
+ for _, pr := range current.Supplemental().Plurals[1].PluralRanges {
+
+ locs := strings.Split(pr.Locales, " ")
+
+ for _, loc := range locs {
+
+ if loc == baseLocale {
+ pluralRange = pr
+ }
+ }
+ }
+
+ // no range plural rules for locale
+ if pluralRange == nil {
+ plurals = "nil"
+ results = "return locales.PluralRuleUnknown"
+ return
+ }
+
+ mp := make(map[string]struct{})
+
+ // pre-process if all the same
+ for _, rule := range pluralRange.PluralRange {
+ mp[rule.Result] = struct{}{}
+ }
+
+ for k := range mp {
+ psI := pluralStringToInt(k)
+ pluralArr = append(pluralArr, psI)
+ }
+
+ if len(mp) == 1 {
+ results += "return locales." + pluralStringToString(pluralRange.PluralRange[0].Result)
+ plurals = fmt.Sprintf("%#v", pluralArr)
+ return
+ }
+
+ multiple := len(pluralRange.PluralRange) > 1
+
+ if multiple {
+ results += "start := " + baseLocale + ".CardinalPluralRule(num1, v1)\n"
+ results += "end := " + baseLocale + ".CardinalPluralRule(num2, v2)\n\n"
+ }
+
+ first := true
+
+ // pre parse for variables
+ for i, rule := range pluralRange.PluralRange {
+
+ if i == len(pluralRange.PluralRange)-1 {
+
+ if multiple {
+ results += "\n\n"
+ }
+ results += "return locales." + pluralStringToString(rule.Result)
+ continue
+ }
+
+ if first {
+ results += "if"
+ first = false
+ } else {
+ results += "else if"
+ }
+
+ results += " start == locales." + pluralStringToString(rule.Start) + " && end == locales." + pluralStringToString(rule.End) + " {\n return locales." + pluralStringToString(rule.Result) + "\n} "
+
+ }
+
+ if multiple {
+ results = "\n" + results + "\n"
+ }
+
+ if len(pluralArr) == 0 {
+ plurals = "nil"
+ } else {
+
+ ints := make([]int, len(pluralArr))
+ for i := 0; i < len(pluralArr); i++ {
+ ints[i] = int(pluralArr[i])
+ }
+
+ sort.Ints(ints)
+
+ for i := 0; i < len(ints); i++ {
+ pluralArr[i] = locales.PluralRule(ints[i])
+ }
+
+ plurals = fmt.Sprintf("%#v", pluralArr)
+ }
+
+ return
+
+}
+
+// TODO: cleanup function logic perhaps write a lexer... but it's working right now, and
+// I'm already farther down the rabbit hole than I'd like and so pulling the chute here.
+func parseOrdinalPluralRuleFunc(current *cldr.CLDR, baseLocale string) (results string, plurals string) {
+
+ var prOrdinal *struct {
+ cldr.Common
+ Locales string "xml:\"locales,attr\""
+ PluralRule []*struct {
+ cldr.Common
+ Count string "xml:\"count,attr\""
+ } "xml:\"pluralRule\""
+ }
+
+ var pluralArr []locales.PluralRule
+
+ // idx 0 is ordinal rules
+ for _, pr := range current.Supplemental().Plurals[0].PluralRules {
+
+ locs := strings.Split(pr.Locales, " ")
+
+ for _, loc := range locs {
+
+ if loc == baseLocale {
+
+ prOrdinal = pr
+ // for _, pl := range pr.PluralRule {
+ // fmt.Println(pl.Count, pl.Common.Data())
+ // }
+ }
+ }
+ }
+
+ // no plural rules for locale
+ if prOrdinal == nil {
+ plurals = "nil"
+ results = "return locales.PluralRuleUnknown"
+ return
+ }
+
+ vals := make(map[string]struct{})
+ first := true
+
+ // pre parse for variables
+ for _, rule := range prOrdinal.PluralRule {
+
+ ps1 := pluralStringToString(rule.Count)
+ psI := pluralStringToInt(rule.Count)
+ pluralArr = append(pluralArr, psI)
+
+ data := strings.Replace(strings.Replace(strings.Replace(strings.TrimSpace(strings.SplitN(rule.Common.Data(), "@", 2)[0]), " = ", " == ", -1), " or ", " || ", -1), " and ", " && ", -1)
+
+ if len(data) == 0 {
+ if len(prOrdinal.PluralRule) == 1 {
+
+ results = "return locales." + ps1
+
+ } else {
+
+ results += "\n\nreturn locales." + ps1
+ // results += "else {\nreturn locales." + locales.PluralStringToString(rule.Count) + ", nil\n}"
+ }
+
+ continue
+ }
+
+ // // All need n, so always add
+ // if strings.Contains(data, "n") {
+ // vals[prVarFuncs["n"]] = struct{}{}
+ // }
+
+ if strings.Contains(data, "i") {
+ vals[prVarFuncs["i"]] = struct{}{}
+ }
+
+ // v is inherently avaialable as an argument
+ // if strings.Contains(data, "v") {
+ // vals[prVarFuncs["v"]] = struct{}{}
+ // }
+
+ if strings.Contains(data, "w") {
+ vals[prVarFuncs["w"]] = struct{}{}
+ }
+
+ if strings.Contains(data, "f") {
+ vals[prVarFuncs["f"]] = struct{}{}
+ }
+
+ if strings.Contains(data, "t") {
+ vals[prVarFuncs["t"]] = struct{}{}
+ }
+
+ if first {
+ results += "if "
+ first = false
+ } else {
+ results += "else if "
+ }
+
+ stmt := ""
+
+ // real work here
+ //
+ // split by 'or' then by 'and' allowing to better
+ // determine bracketing for formula
+
+ ors := strings.Split(data, "||")
+
+ for _, or := range ors {
+
+ stmt += "("
+
+ ands := strings.Split(strings.TrimSpace(or), "&&")
+
+ for _, and := range ands {
+
+ inArg := false
+ pre := ""
+ lft := ""
+ preOperator := ""
+ args := strings.Split(strings.TrimSpace(and), " ")
+
+ for _, a := range args {
+
+ if inArg {
+ // check to see if is a value range 2..9
+
+ multiRange := strings.Count(a, "..") > 1
+ cargs := strings.Split(strings.TrimSpace(a), ",")
+ hasBracket := len(cargs) > 1
+ bracketAdded := false
+ lastWasRange := false
+
+ for _, carg := range cargs {
+
+ if rng := strings.Split(carg, ".."); len(rng) > 1 {
+
+ if multiRange {
+ pre += " ("
+ } else {
+ pre += " "
+ }
+
+ switch preOperator {
+ case "==":
+ pre += lft + " >= " + rng[0] + " && " + lft + "<=" + rng[1]
+ case "!=":
+ pre += "(" + lft + " < " + rng[0] + " || " + lft + " > " + rng[1] + ")"
+ }
+
+ if multiRange {
+ pre += ") || "
+ } else {
+ pre += " || "
+ }
+
+ lastWasRange = true
+ continue
+ }
+
+ if lastWasRange {
+ pre = strings.TrimRight(pre, " || ") + " && "
+ }
+
+ lastWasRange = false
+
+ if hasBracket && !bracketAdded {
+ pre += "("
+ bracketAdded = true
+ }
+
+ // single comma separated values
+ switch preOperator {
+ case "==":
+ pre += " " + lft + preOperator + carg + " || "
+ case "!=":
+ pre += " " + lft + preOperator + carg + " && "
+ }
+
+ }
+
+ pre = strings.TrimRight(pre, " || ")
+ pre = strings.TrimRight(pre, " && ")
+ pre = strings.TrimRight(pre, " || ")
+
+ if hasBracket && bracketAdded {
+ pre += ")"
+ }
+
+ continue
+ }
+
+ if strings.Contains(a, "=") || a == ">" || a == "<" {
+ inArg = true
+ preOperator = a
+ continue
+ }
+
+ lft += a
+ }
+
+ stmt += pre + " && "
+ }
+
+ stmt = strings.TrimRight(stmt, " && ") + ") || "
+ }
+
+ stmt = strings.TrimRight(stmt, " || ")
+
+ results += stmt
+
+ results += " {\n"
+
+ // return plural rule here
+ results += "return locales." + ps1 + "\n"
+
+ results += "}"
+ }
+
+ pre := "\n"
+
+ // always needed
+ vals[prVarFuncs["n"]] = struct{}{}
+
+ sorted := make([]sortRank, 0, len(vals))
+
+ for k := range vals {
+ switch k[:1] {
+ case "n":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["n"],
+ Rank: 1,
+ })
+ case "i":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["i"],
+ Rank: 2,
+ })
+ case "w":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["w"],
+ Rank: 3,
+ })
+ case "f":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["f"],
+ Rank: 4,
+ })
+ case "t":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["t"],
+ Rank: 5,
+ })
+ }
+ }
+
+ sort.Sort(ByRank(sorted))
+
+ for _, k := range sorted {
+ pre += k.Value
+ }
+
+ if len(results) == 0 {
+ results = "return locales.PluralRuleUnknown"
+ } else {
+
+ if !strings.HasPrefix(results, "return") {
+
+ results = manyToSingleVars(results)
+ // pre += "\n"
+ results = pre + results
+ }
+ }
+
+ if len(pluralArr) == 0 {
+ plurals = "nil"
+ } else {
+ plurals = fmt.Sprintf("%#v", pluralArr)
+ }
+
+ return
+}
+
+// TODO: cleanup function logic perhaps write a lexer... but it's working right now, and
+// I'm already farther down the rabbit hole than I'd like and so pulling the chute here.
+//
+// updated to also accept actual locale as 'pt_PT' exists in cardinal rules different from 'pt'
+func parseCardinalPluralRuleFunc(current *cldr.CLDR, locale, baseLocale string) (results string, plurals string) {
+
+ var prCardinal *struct {
+ cldr.Common
+ Locales string "xml:\"locales,attr\""
+ PluralRule []*struct {
+ cldr.Common
+ Count string "xml:\"count,attr\""
+ } "xml:\"pluralRule\""
+ }
+
+ var pluralArr []locales.PluralRule
+ var inBaseLocale bool
+ l := locale
+
+FIND:
+ // idx 2 is cardinal rules
+ for _, pr := range current.Supplemental().Plurals[2].PluralRules {
+
+ locs := strings.Split(pr.Locales, " ")
+
+ for _, loc := range locs {
+
+ if loc == l {
+ prCardinal = pr
+ }
+ }
+ }
+
+ // no plural rules for locale
+ if prCardinal == nil {
+
+ if !inBaseLocale {
+ inBaseLocale = true
+ l = baseLocale
+ goto FIND
+ }
+
+ plurals = "nil"
+ results = "return locales.PluralRuleUnknown"
+ return
+ }
+
+ vals := make(map[string]struct{})
+ first := true
+
+ // pre parse for variables
+ for _, rule := range prCardinal.PluralRule {
+
+ ps1 := pluralStringToString(rule.Count)
+ psI := pluralStringToInt(rule.Count)
+ pluralArr = append(pluralArr, psI)
+
+ data := strings.Replace(strings.Replace(strings.Replace(strings.TrimSpace(strings.SplitN(rule.Common.Data(), "@", 2)[0]), " = ", " == ", -1), " or ", " || ", -1), " and ", " && ", -1)
+
+ if len(data) == 0 {
+ if len(prCardinal.PluralRule) == 1 {
+
+ results = "return locales." + ps1
+
+ } else {
+
+ results += "\n\nreturn locales." + ps1
+ // results += "else {\nreturn locales." + locales.PluralStringToString(rule.Count) + ", nil\n}"
+ }
+
+ continue
+ }
+
+ // // All need n, so always add
+ // if strings.Contains(data, "n") {
+ // vals[prVarFuncs["n"]] = struct{}{}
+ // }
+
+ if strings.Contains(data, "i") {
+ vals[prVarFuncs["i"]] = struct{}{}
+ }
+
+ // v is inherently avaialable as an argument
+ // if strings.Contains(data, "v") {
+ // vals[prVarFuncs["v"]] = struct{}{}
+ // }
+
+ if strings.Contains(data, "w") {
+ vals[prVarFuncs["w"]] = struct{}{}
+ }
+
+ if strings.Contains(data, "f") {
+ vals[prVarFuncs["f"]] = struct{}{}
+ }
+
+ if strings.Contains(data, "t") {
+ vals[prVarFuncs["t"]] = struct{}{}
+ }
+
+ if first {
+ results += "if "
+ first = false
+ } else {
+ results += "else if "
+ }
+
+ stmt := ""
+
+ // real work here
+ //
+ // split by 'or' then by 'and' allowing to better
+ // determine bracketing for formula
+
+ ors := strings.Split(data, "||")
+
+ for _, or := range ors {
+
+ stmt += "("
+
+ ands := strings.Split(strings.TrimSpace(or), "&&")
+
+ for _, and := range ands {
+
+ inArg := false
+ pre := ""
+ lft := ""
+ preOperator := ""
+ args := strings.Split(strings.TrimSpace(and), " ")
+
+ for _, a := range args {
+
+ if inArg {
+ // check to see if is a value range 2..9
+
+ multiRange := strings.Count(a, "..") > 1
+ cargs := strings.Split(strings.TrimSpace(a), ",")
+ hasBracket := len(cargs) > 1
+ bracketAdded := false
+ lastWasRange := false
+
+ for _, carg := range cargs {
+
+ if rng := strings.Split(carg, ".."); len(rng) > 1 {
+
+ if multiRange {
+ pre += " ("
+ } else {
+ pre += " "
+ }
+
+ switch preOperator {
+ case "==":
+ pre += lft + " >= " + rng[0] + " && " + lft + "<=" + rng[1]
+ case "!=":
+ pre += "(" + lft + " < " + rng[0] + " || " + lft + " > " + rng[1] + ")"
+ }
+
+ if multiRange {
+ pre += ") || "
+ } else {
+ pre += " || "
+ }
+
+ lastWasRange = true
+ continue
+ }
+
+ if lastWasRange {
+ pre = strings.TrimRight(pre, " || ") + " && "
+ }
+
+ lastWasRange = false
+
+ if hasBracket && !bracketAdded {
+ pre += "("
+ bracketAdded = true
+ }
+
+ // single comma separated values
+ switch preOperator {
+ case "==":
+ pre += " " + lft + preOperator + carg + " || "
+ case "!=":
+ pre += " " + lft + preOperator + carg + " && "
+ }
+
+ }
+
+ pre = strings.TrimRight(pre, " || ")
+ pre = strings.TrimRight(pre, " && ")
+ pre = strings.TrimRight(pre, " || ")
+
+ if hasBracket && bracketAdded {
+ pre += ")"
+ }
+
+ continue
+ }
+
+ if strings.Contains(a, "=") || a == ">" || a == "<" {
+ inArg = true
+ preOperator = a
+ continue
+ }
+
+ lft += a
+ }
+
+ stmt += pre + " && "
+ }
+
+ stmt = strings.TrimRight(stmt, " && ") + ") || "
+ }
+
+ stmt = strings.TrimRight(stmt, " || ")
+
+ results += stmt
+
+ results += " {\n"
+
+ // return plural rule here
+ results += "return locales." + ps1 + "\n"
+
+ results += "}"
+ }
+
+ pre := "\n"
+
+ // always needed
+ vals[prVarFuncs["n"]] = struct{}{}
+
+ sorted := make([]sortRank, 0, len(vals))
+
+ for k := range vals {
+ switch k[:1] {
+ case "n":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["n"],
+ Rank: 1,
+ })
+ case "i":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["i"],
+ Rank: 2,
+ })
+ case "w":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["w"],
+ Rank: 3,
+ })
+ case "f":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["f"],
+ Rank: 4,
+ })
+ case "t":
+ sorted = append(sorted, sortRank{
+ Value: prVarFuncs["t"],
+ Rank: 5,
+ })
+ }
+ }
+
+ sort.Sort(ByRank(sorted))
+
+ for _, k := range sorted {
+ pre += k.Value
+ }
+
+ if len(results) == 0 {
+ results = "return locales.PluralRuleUnknown"
+ } else {
+
+ if !strings.HasPrefix(results, "return") {
+
+ results = manyToSingleVars(results)
+ // pre += "\n"
+ results = pre + results
+ }
+ }
+
+ if len(pluralArr) == 0 {
+ plurals = "nil"
+ } else {
+ plurals = fmt.Sprintf("%#v", pluralArr)
+ }
+
+ return
+}
+
+func manyToSingleVars(input string) (results string) {
+
+ matches := nModRegex.FindAllString(input, -1)
+ mp := make(map[string][]string) // map of formula to variable
+ var found bool
+ var split []string
+ var variable string
+
+ for _, formula := range matches {
+
+ if _, found = mp[formula]; found {
+ continue
+ }
+
+ split = strings.SplitN(formula, "%", 2)
+
+ mp[formula] = []string{split[1], "math.Mod(" + split[0] + ", " + split[1] + ")"}
+ }
+
+ for k, v := range mp {
+ variable = "nMod" + v[0]
+ results += variable + " := " + v[1] + "\n"
+ input = strings.Replace(input, k, variable, -1)
+ }
+
+ matches = iModRegex.FindAllString(input, -1)
+ mp = make(map[string][]string) // map of formula to variable
+
+ for _, formula := range matches {
+
+ if _, found = mp[formula]; found {
+ continue
+ }
+
+ split = strings.SplitN(formula, "%", 2)
+
+ mp[formula] = []string{split[1], formula}
+ }
+
+ for k, v := range mp {
+ variable = "iMod" + v[0]
+ results += variable + " := " + v[1] + "\n"
+ input = strings.Replace(input, k, variable, -1)
+ }
+
+ matches = wModRegex.FindAllString(input, -1)
+ mp = make(map[string][]string) // map of formula to variable
+
+ for _, formula := range matches {
+
+ if _, found = mp[formula]; found {
+ continue
+ }
+
+ split = strings.SplitN(formula, "%", 2)
+
+ mp[formula] = []string{split[1], formula}
+ }
+
+ for k, v := range mp {
+ variable = "wMod" + v[0]
+ results += variable + " := " + v[1] + "\n"
+ input = strings.Replace(input, k, variable, -1)
+ }
+
+ matches = fModRegex.FindAllString(input, -1)
+ mp = make(map[string][]string) // map of formula to variable
+
+ for _, formula := range matches {
+
+ if _, found = mp[formula]; found {
+ continue
+ }
+
+ split = strings.SplitN(formula, "%", 2)
+
+ mp[formula] = []string{split[1], formula}
+ }
+
+ for k, v := range mp {
+ variable = "fMod" + v[0]
+ results += variable + " := " + v[1] + "\n"
+ input = strings.Replace(input, k, variable, -1)
+ }
+
+ matches = tModRegex.FindAllString(input, -1)
+ mp = make(map[string][]string) // map of formula to variable
+
+ for _, formula := range matches {
+
+ if _, found = mp[formula]; found {
+ continue
+ }
+
+ split = strings.SplitN(formula, "%", 2)
+
+ mp[formula] = []string{split[1], formula}
+ }
+
+ for k, v := range mp {
+ variable = "tMod" + v[0]
+ results += variable + " := " + v[1] + "\n"
+ input = strings.Replace(input, k, variable, -1)
+ }
+
+ results = results + "\n" + input
+
+ return
+}
+
+// pluralStringToInt returns the enum value of 'plural' provided
+func pluralStringToInt(plural string) locales.PluralRule {
+
+ switch plural {
+ case "zero":
+ return locales.PluralRuleZero
+ case "one":
+ return locales.PluralRuleOne
+ case "two":
+ return locales.PluralRuleTwo
+ case "few":
+ return locales.PluralRuleFew
+ case "many":
+ return locales.PluralRuleMany
+ case "other":
+ return locales.PluralRuleOther
+ default:
+ return locales.PluralRuleUnknown
+ }
+}
+
+func pluralStringToString(pr string) string {
+
+ pr = strings.TrimSpace(pr)
+
+ switch pr {
+ case "zero":
+ return "PluralRuleZero"
+ case "one":
+ return "PluralRuleOne"
+ case "two":
+ return "PluralRuleTwo"
+ case "few":
+ return "PluralRuleFew"
+ case "many":
+ return "PluralRuleMany"
+ case "other":
+ return "PluralRuleOther"
+ default:
+ return "PluralRuleUnknown"
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cmd/locale_map.tmpl b/vendor/github.com/go-playground/locales/cmd/locale_map.tmpl
new file mode 100644
index 000000000..d3e0db56d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/locale_map.tmpl
@@ -0,0 +1,34 @@
+{{ define "localeslist" }}
+package localeslist
+
+import (
+ "sync"
+)
+
+// LocaleFunc is the function to run in order to create
+// a new instance of a given locale
+type LocaleFunc func() locales.Translator
+
+// LocaleMap is map of locale string to instance function
+type LocaleMap map[string]LocaleFunc
+
+
+var (
+ once sync.Once
+ localeMap LocaleMap
+)
+
+func init() {
+ once.Do(func(){
+ localeMap = map[string]LocaleFunc{
+ {{ . }}
+ }
+ })
+}
+
+// Map returns the map of locales to instance New function
+func Map() LocaleMap {
+ return localeMap
+}
+
+{{ end }}
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/cmd/tests.tmpl b/vendor/github.com/go-playground/locales/cmd/tests.tmpl
new file mode 100644
index 000000000..2d2147a89
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/tests.tmpl
@@ -0,0 +1,1123 @@
+{{ define "tests" }}
+package {{ .Locale }}
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "{{ .Locale }}"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+{{ end }}
\ No newline at end of file
diff --git a/vendor/github.com/go-playground/locales/cmd/translator.tmpl b/vendor/github.com/go-playground/locales/cmd/translator.tmpl
new file mode 100644
index 000000000..727d6905b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cmd/translator.tmpl
@@ -0,0 +1,985 @@
+{{ define "translator" }}
+package {{ .Locale }}
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type {{ .Locale }} struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ {{- if gt (len .FmtPercentPrefix) 0}}
+ percentPrefix string
+ {{- end }}
+ {{- if gt (len .FmtPercentSuffix) 0}}
+ percentSuffix string
+ {{- end }}
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ {{- if gt (len .FmtCurrencyPrefix) 0}}
+ currencyPositivePrefix string
+ {{- end }}
+ {{- if gt (len .FmtCurrencySuffix) 0}}
+ currencyPositiveSuffix string
+ {{- end }}
+ {{- if gt (len .FmtCurrencyNegativePrefix) 0}}
+ currencyNegativePrefix string
+ {{- end }}
+ {{- if gt (len .FmtCurrencyNegativeSuffix) 0}}
+ currencyNegativeSuffix string
+ {{- end }}
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the '{{ .Locale }}' locale
+func New() locales.Translator {
+ return &{{ .Locale }}{
+ locale: "{{ .Locale }}",
+ pluralsCardinal: {{ .Plurals }},
+ pluralsOrdinal: {{ .PluralsOrdinal }},
+ pluralsRange: {{ .PluralsRange }},
+ {{- if gt (len .Decimal) 0}}
+ decimal: "{{ .Decimal }}",
+ {{- end}}
+ {{- if gt (len .Group) 0}}
+ group: "{{ .Group }}",
+ {{- end}}
+ {{- if gt (len .Minus) 0}}
+ minus: "{{ .Minus }}",
+ {{- end}}
+ {{- if gt (len .Percent) 0}}
+ percent: "{{ .Percent }}",
+ {{- end}}
+ {{- if gt (len .PerMille) 0}}
+ perMille: "{{ .PerMille }}",
+ {{- end}}
+ {{- if gt (len .TimeSeparator) 0}}
+ timeSeparator: "{{ .TimeSeparator }}",
+ {{- end}}
+ {{- if gt (len .Infinity) 0}}
+ inifinity: "{{ .Infinity }}",
+ {{- end}}
+ currencies: {{ .Currencies }},
+ {{- if gt (len .FmtPercentPrefix) 0}}
+ percentPrefix: "{{ .FmtPercentPrefix }}",
+ {{- end -}}
+ {{- if gt (len .FmtPercentSuffix) 0}}
+ percentSuffix: "{{ .FmtPercentSuffix }}",
+ {{- end -}}
+ {{- if gt (len .FmtCurrencyPrefix) 0}}
+ currencyPositivePrefix: "{{ .FmtCurrencyPrefix }}",
+ {{- end -}}
+ {{- if gt (len .FmtCurrencySuffix) 0}}
+ currencyPositiveSuffix: "{{ .FmtCurrencySuffix }}",
+ {{- end -}}
+ {{- if gt (len .FmtCurrencyNegativePrefix) 0}}
+ currencyNegativePrefix: "{{ .FmtCurrencyNegativePrefix }}",
+ {{- end -}}
+ {{- if gt (len .FmtCurrencyNegativeSuffix) 0}}
+ currencyNegativeSuffix: "{{ .FmtCurrencyNegativeSuffix }}",
+ {{- end -}}
+ {{- if gt (len .FmtMonthsAbbreviated) 0 }}
+ monthsAbbreviated: {{ .FmtMonthsAbbreviated }},
+ {{- end -}}
+ {{- if gt (len .FmtMonthsNarrow) 0 }}
+ monthsNarrow: {{ .FmtMonthsNarrow }},
+ {{- end -}}
+ {{- if gt (len .FmtMonthsWide) 0 }}
+ monthsWide: {{ .FmtMonthsWide }},
+ {{- end -}}
+ {{- if gt (len .FmtDaysAbbreviated) 0 }}
+ daysAbbreviated: {{ .FmtDaysAbbreviated }},
+ {{- end -}}
+ {{- if gt (len .FmtDaysNarrow) 0 }}
+ daysNarrow: {{ .FmtDaysNarrow }},
+ {{- end -}}
+ {{- if gt (len .FmtDaysShort) 0 }}
+ daysShort: {{ .FmtDaysShort }},
+ {{- end -}}
+ {{- if gt (len .FmtDaysWide) 0 }}
+ daysWide: {{ .FmtDaysWide }},
+ {{- end -}}
+ {{- if gt (len .FmtPeriodsAbbreviated) 0 }}
+ periodsAbbreviated: {{ .FmtPeriodsAbbreviated }},
+ {{- end -}}
+ {{- if gt (len .FmtPeriodsNarrow) 0 }}
+ periodsNarrow: {{ .FmtPeriodsNarrow }},
+ {{- end -}}
+ {{- if gt (len .FmtPeriodsShort) 0 }}
+ periodsShort: {{ .FmtPeriodsShort }},
+ {{- end -}}
+ {{- if gt (len .FmtPeriodsWide) 0 }}
+ periodsWide: {{ .FmtPeriodsWide }},
+ {{- end -}}
+ {{- if gt (len .FmtErasAbbreviated) 0 }}
+ erasAbbreviated: {{ .FmtErasAbbreviated }},
+ {{- end -}}
+ {{- if gt (len .FmtErasNarrow) 0 }}
+ erasNarrow: {{ .FmtErasNarrow }},
+ {{- end -}}
+ {{- if gt (len .FmtErasWide) 0 }}
+ erasWide: {{ .FmtErasWide }},
+ {{- end }}
+ timezones: {{ .FmtTimezones }},
+ }
+}
+
+// Locale returns the current translators string locale
+func({{ .BaseLocale }} *{{ .Locale }}) Locale() string {
+ return {{ .BaseLocale }}.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) PluralsCardinal() []locales.PluralRule {
+ return {{ .BaseLocale }}.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) PluralsOrdinal() []locales.PluralRule {
+ return {{ .BaseLocale }}.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) PluralsRange() []locales.PluralRule {
+ return {{ .BaseLocale }}.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ {{ .CardinalFunc }}
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ {{ .OrdinalFunc }}
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) RangePluralRule(num1 float64, v1 uint64,num2 float64, v2 uint64) locales.PluralRule {
+ {{ .RangeFunc }}
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func({{ .BaseLocale }} *{{ .Locale }}) MonthAbbreviated(month time.Month) string {
+ return {{ .BaseLocale }}.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func({{ .BaseLocale }} *{{ .Locale }}) MonthsAbbreviated() []string {
+ {{- if gt (len .FmtMonthsAbbreviated) 0 }}
+ return {{ .BaseLocale }}.monthsAbbreviated[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func({{ .BaseLocale }} *{{ .Locale }}) MonthNarrow(month time.Month) string {
+ return {{ .BaseLocale }}.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func({{ .BaseLocale }} *{{ .Locale }}) MonthsNarrow() []string {
+ {{- if gt (len .FmtMonthsNarrow) 0 }}
+ return {{ .BaseLocale }}.monthsNarrow[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func({{ .BaseLocale }} *{{ .Locale }}) MonthWide(month time.Month) string {
+ return {{ .BaseLocale }}.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func({{ .BaseLocale }} *{{ .Locale }}) MonthsWide() []string {
+ {{- if gt (len .FmtMonthsWide) 0 }}
+ return {{ .BaseLocale }}.monthsWide[1:]
+ {{ else }}
+ return nil
+ {{- end -}}
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdayAbbreviated(weekday time.Weekday) string {
+ return {{ .BaseLocale }}.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdaysAbbreviated() []string {
+ return {{ .BaseLocale }}.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdayNarrow(weekday time.Weekday) string {
+ return {{ .BaseLocale }}.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdaysNarrow() []string {
+ return {{ .BaseLocale }}.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdayShort(weekday time.Weekday) string {
+ return {{ .BaseLocale }}.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdaysShort() []string {
+ return {{ .BaseLocale }}.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdayWide(weekday time.Weekday) string {
+ return {{ .BaseLocale }}.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func({{ .BaseLocale }} *{{ .Locale }}) WeekdaysWide() []string {
+ return {{ .BaseLocale }}.daysWide
+}
+
+// Decimal returns the decimal point of number
+func({{ .BaseLocale }} *{{ .Locale }}) Decimal() string {
+ return {{ .BaseLocale }}.decimal
+}
+
+// Group returns the group of number
+func({{ .BaseLocale }} *{{ .Locale }}) Group() string {
+ return {{ .BaseLocale }}.group
+}
+
+// Group returns the minus sign of number
+func({{ .BaseLocale }} *{{ .Locale }}) Minus() string {
+ return {{ .BaseLocale }}.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for '{{ .Locale }}' and handles both Whole and Real numbers based on 'v'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtNumber(num float64, v uint64) string {
+
+ {{ if eq .FmtNumberExists true }}
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ {{- if gt .FmtNumberGroupLen 0 }}
+ {{- $byteCountGroup := byte_count .Group -}}
+ {{ if ne $byteCountGroup "0" }}
+ l := len(s) + {{ byte_count .Decimal .Minus }} + {{ $byteCountGroup }} * len(s[:len(s)-int(v)-1]) / {{ .FmtNumberGroupLen }}
+ {{ else }}
+ l := len(s) + {{ byte_count .Decimal .Minus }}
+ {{ end -}}
+ count := 0
+ inWhole := v == 0
+ {{- if gt .FmtNumberSecondaryGroupLen 0}}
+ inSecondary := false
+ groupThreshold := {{ .FmtNumberGroupLen }}
+ {{ end -}}
+ {{ else }}
+ l := len(s) + {{ byte_count .Decimal .Minus }}
+ {{ end }}
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+
+ {{- if is_multibyte .Decimal }}
+ for j := len({{ .BaseLocale }}.decimal) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.decimal[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.decimal[0])
+ {{- end -}}
+ {{- if gt .FmtNumberGroupLen 0 }}
+ inWhole = true
+ {{- end }}
+ continue
+ }
+
+ {{ if gt .FmtNumberGroupLen 0 }}
+ if inWhole {
+
+ {{- if gt .FmtNumberSecondaryGroupLen 0}}
+
+ if count == groupThreshold {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = {{ .FmtNumberSecondaryGroupLen }}
+ }
+ {{ else }}
+ if count == {{ .FmtNumberGroupLen }} {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+ {{ end -}}
+ } else {
+ count++
+ }
+ }
+
+ {{ end }}
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ {{- if is_multibyte .Minus }}
+ for j := len({{ .BaseLocale }}.minus) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.minus[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.minus[0])
+ {{ end -}}
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ {{ if gt .FmtNumberMinDecimalLen 0 }}
+ if int(v) < {{ .FmtNumberMinDecimalLen }} {
+
+ if v == 0 {
+ b = append(b, {{ .BaseLocale }}.decimal...)
+ }
+
+ for i := 0; i < {{ .FmtNumberMinDecimalLen }}-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+ {{ end }}
+
+ return string(b)
+ {{ else }}
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ {{ end -}}
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for '{{ .Locale }}' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func({{ .BaseLocale }} *{{ .Locale }}) FmtPercent(num float64, v uint64) string {
+
+ {{- if eq .FmtPercentExists true }}
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ {{- if gt .FmtPercentGroupLen 0 }}
+ {{- $byteCountGroup := byte_count .Group -}}
+ {{ if ne $byteCountGroup "0" }}
+ l := len(s) + {{ byte_count .Decimal .Minus .Percent .FmtPercentPrefix .FmtPercentSuffix }} + {{ $byteCountGroup }} * len(s[:len(s)-int(v)-1]) / {{ .FmtPercentGroupLen }}
+ {{ else }}
+ l := len(s) + {{ byte_count .Decimal .Minus .Percent .FmtPercentPrefix .FmtPercentSuffix }}
+ {{ end -}}
+ count := 0
+ inWhole := v == 0
+ {{- if gt .FmtPercentSecondaryGroupLen 0}}
+ inSecondary := false
+ groupThreshold := {{ .FmtPercentGroupLen }}
+ {{ end -}}
+ {{ else }}
+ l := len(s) + {{ byte_count .Decimal .Minus .Percent .FmtPercentPrefix .FmtPercentSuffix }}
+ {{- end }}
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+
+ {{- if is_multibyte .Decimal }}
+ for j := len({{ .BaseLocale }}.decimal) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.decimal[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.decimal[0])
+ {{- end -}}
+ {{- if gt .FmtPercentGroupLen 0 }}
+ inWhole = true
+ {{ end }}
+ continue
+ }
+
+ {{ if gt .FmtPercentGroupLen 0 }}
+ if inWhole {
+
+ {{- if gt .FmtPercentSecondaryGroupLen 0}}
+
+ if count == groupThreshold {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = {{ .FmtPercentSecondaryGroupLen }}
+ }
+ {{ else }}
+ if count == {{ .FmtPercentGroupLen }} {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+ {{ end -}}
+ } else {
+ count++
+ }
+ }
+
+ {{ end }}
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ {{- if is_multibyte .Minus }}
+ for j := len({{ .BaseLocale }}.minus) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.minus[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.minus[0])
+ {{ end -}}
+ }
+
+ {{ if and .FmtPercentInPrefix (not .FmtPercentLeft) }}
+ {{- if is_multibyte .Percent }}
+ for j := len({{ .BaseLocale }}.percent) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.percent[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.percent[0])
+ {{ end }}
+ {{ end }}
+
+ {{ if gt (len .FmtPercentPrefix) 0}}
+ {{- if is_multibyte .FmtPercentPrefix }}
+ for j := len({{ .BaseLocale }}.percentPrefix) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.percentPrefix[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.percentPrefix[0])
+ {{ end }}
+ {{ end }}
+
+ {{ if and .FmtPercentInPrefix .FmtPercentLeft }}
+ {{- if is_multibyte .Percent }}
+ for j := len({{ .BaseLocale }}.percent) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.percent[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.percent[0])
+ {{ end }}
+ {{ end }}
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ {{ if gt .FmtPercentMinDecimalLen 0 }}
+ if int(v) < {{ .FmtPercentMinDecimalLen }} {
+
+ if v == 0 {
+ b = append(b, {{ .BaseLocale }}.decimal...)
+ }
+
+ for i := 0; i < {{ .FmtPercentMinDecimalLen }}-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+ {{ end }}
+
+ {{ if and (not .FmtPercentInPrefix) .FmtPercentLeft }}
+ b = append(b, {{ .BaseLocale }}.percent...)
+ {{ end }}
+
+ {{ if gt (len .FmtPercentSuffix) 0}}
+ b = append(b, {{ .BaseLocale }}.percentSuffix...)
+ {{ end }}
+
+ {{ if and (not .FmtPercentInPrefix) (not .FmtPercentLeft) }}
+ b = append(b, {{ .BaseLocale }}.percent...)
+ {{ end }}
+
+ return string(b)
+ {{ else }}
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ {{ end -}}
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := {{ .BaseLocale }}.currencies[currency]
+ {{- if eq .FmtCurrencyExists true }}
+ {{- if gt .FmtCurrencyGroupLen 0 }}
+ {{- $byteCountGroup := byte_count .Group -}}
+ {{ if ne $byteCountGroup "0" }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyPrefix .FmtCurrencySuffix }} + {{ $byteCountGroup }} * len(s[:len(s)-int(v)-1]) / {{ .FmtCurrencyGroupLen }}
+ {{ else }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyPrefix .FmtCurrencySuffix }}
+ {{ end -}}
+ count := 0
+ inWhole := v == 0
+ {{- if gt .FmtCurrencySecondaryGroupLen 0}}
+ inSecondary := false
+ groupThreshold := {{ .FmtCurrencyGroupLen }}
+ {{ end -}}
+ {{ else }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyPrefix .FmtCurrencySuffix }}
+ {{ end }}
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+
+ {{- if is_multibyte .Decimal }}
+ for j := len({{ .BaseLocale }}.decimal) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.decimal[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.decimal[0])
+ {{- end -}}
+ {{- if gt .FmtCurrencyGroupLen 0 }}
+ inWhole = true
+ {{- end }}
+ continue
+ }
+
+ {{ if gt .FmtCurrencyGroupLen 0 }}
+ if inWhole {
+
+ {{- if gt .FmtCurrencySecondaryGroupLen 0}}
+
+ if count == groupThreshold {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = {{ .FmtCurrencySecondaryGroupLen }}
+ }
+ {{ else }}
+ if count == {{ .FmtCurrencyGroupLen }} {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+ {{ end -}}
+ } else {
+ count++
+ }
+ }
+
+ {{ end }}
+
+ b = append(b, s[i])
+ }
+
+ {{ if and .FmtCurrencyInPrefix (not .FmtCurrencyLeft) }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{ end }}
+
+ {{ if gt (len .FmtCurrencyPrefix) 0}}
+ {{- if is_multibyte .FmtCurrencyPrefix }}
+ for j := len({{ .BaseLocale }}.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.currencyPositivePrefix[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.currencyPositivePrefix[0])
+ {{ end }}
+ {{ end }}
+
+ {{ if and .FmtCurrencyInPrefix .FmtCurrencyLeft }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{ end }}
+
+ if num < 0 {
+ {{- if is_multibyte .Minus }}
+ for j := len({{ .BaseLocale }}.minus) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.minus[j])
+ }
+ {{ else -}}
+ b = append(b, {{ .BaseLocale }}.minus[0])
+ {{ end -}}
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ {{ if gt .FmtCurrencyMinDecimalLen 0 }}
+ if int(v) < {{ .FmtCurrencyMinDecimalLen }} {
+
+ if v == 0 {
+ b = append(b, {{ .BaseLocale }}.decimal...)
+ }
+
+ for i := 0; i < {{ .FmtCurrencyMinDecimalLen }}-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+ {{ end }}
+
+ {{ if and (not .FmtCurrencyInPrefix) .FmtCurrencyLeft }}
+ b = append(b, symbol...)
+ {{ end }}
+
+ {{ if gt (len .FmtCurrencySuffix) 0}}
+ b = append(b, {{ .BaseLocale }}.currencyPositiveSuffix...)
+ {{ end }}
+
+ {{ if and (not .FmtCurrencyInPrefix) (not .FmtCurrencyLeft) }}
+ b = append(b, symbol...)
+ {{ end }}
+
+ return string(b)
+ {{ else }}
+ return string(append(append([]byte{}, symbol...), s...))
+ {{ end -}}
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for '{{ .Locale }}'
+// in accounting notation.
+func({{ .BaseLocale }} *{{ .Locale }}) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := {{ .BaseLocale }}.currencies[currency]
+ {{- if eq .FmtCurrencyExists true }}
+ {{- if gt .FmtCurrencyGroupLen 0 }}
+ {{- $byteCountGroup := byte_count .Group -}}
+ {{ if ne $byteCountGroup "0" }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyNegativePrefix .FmtCurrencyNegativeSuffix }} + {{ $byteCountGroup }} * len(s[:len(s)-int(v)-1]) / {{ .FmtCurrencyGroupLen }}
+ {{ else }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyNegativePrefix .FmtCurrencyNegativeSuffix }}
+ {{ end -}}
+ count := 0
+ inWhole := v == 0
+ {{- if gt .FmtCurrencySecondaryGroupLen 0}}
+ inSecondary := false
+ groupThreshold := {{ .FmtCurrencyGroupLen }}
+ {{ end -}}
+ {{ else }}
+ l := len(s) + len(symbol) + {{ byte_count .Decimal .Minus .FmtCurrencyNegativePrefix .FmtCurrencyNegativeSuffix }}
+ {{ end }}
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+
+ {{- if is_multibyte .Decimal }}
+ for j := len({{ .BaseLocale }}.decimal) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.decimal[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.decimal[0])
+ {{- end -}}
+ {{- if gt .FmtCurrencyGroupLen 0 }}
+ inWhole = true
+ {{- end }}
+ continue
+ }
+
+ {{ if gt .FmtCurrencyGroupLen 0 }}
+ if inWhole {
+
+ {{- if gt .FmtCurrencySecondaryGroupLen 0}}
+
+ if count == groupThreshold {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = {{ .FmtCurrencySecondaryGroupLen }}
+ }
+ {{ else }}
+ if count == {{ .FmtCurrencyGroupLen }} {
+ {{- if is_multibyte .Group }}
+ for j := len({{ .BaseLocale }}.group) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.group[j])
+ }
+ {{- else }}
+ b = append(b, {{ .BaseLocale }}.group[0])
+ {{- end }}
+ count = 1
+ {{ end -}}
+ } else {
+ count++
+ }
+ }
+
+ {{ end }}
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ {{ if and .FmtCurrencyNegativeInPrefix (not .FmtCurrencyNegativeLeft) }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{ end }}
+
+ {{ if gt (len .FmtCurrencyNegativePrefix) 0}}
+ {{- if is_multibyte .FmtCurrencyNegativePrefix }}
+ for j := len({{ .BaseLocale }}.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.currencyNegativePrefix[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.currencyNegativePrefix[0])
+ {{ end }}
+ {{ end }}
+
+ {{ if and .FmtCurrencyNegativeInPrefix .FmtCurrencyNegativeLeft }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{ end }}
+
+ {{ if eq (not .FmtCurrencyNegativeExists) true}}
+ {{- if is_multibyte .Minus }}
+ for j := len({{ .BaseLocale }}.minus) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.minus[j])
+ }
+ {{ else -}}
+ b = append(b, {{ .BaseLocale }}.minus[0])
+ {{ end -}}
+ {{ end }}
+
+ {{ if or .FmtCurrencyInPrefix (gt (len .FmtCurrencyPrefix) 0) }}
+ } else {
+ {{ end }}
+
+ {{ if and .FmtCurrencyInPrefix (not .FmtCurrencyLeft) }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{ end }}
+
+ {{ if gt (len .FmtCurrencyPrefix) 0}}
+ {{- if is_multibyte .FmtCurrencyPrefix }}
+ for j := len({{ .BaseLocale }}.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, {{ .BaseLocale }}.currencyPositivePrefix[j])
+ }
+ {{ else }}
+ b = append(b, {{ .BaseLocale }}.currencyPositivePrefix[0])
+ {{ end }}
+ {{ end }}
+
+ {{ if and .FmtCurrencyInPrefix .FmtCurrencyLeft }}
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+ {{- end }}
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ {{ if gt .FmtCurrencyMinDecimalLen 0 }}
+ if int(v) < {{ .FmtCurrencyMinDecimalLen }} {
+
+ if v == 0 {
+ b = append(b, {{ .BaseLocale }}.decimal...)
+ }
+
+ for i := 0; i < {{ .FmtCurrencyMinDecimalLen }}-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+ {{- end }}
+
+ {{ if or (not .FmtCurrencyNegativeInPrefix) (gt (len .FmtCurrencyNegativeSuffix) 0)}}
+ if num < 0 {
+ {{- end }}
+ {{- if and (not .FmtCurrencyNegativeInPrefix) .FmtCurrencyNegativeLeft }}
+ b = append(b, symbol...)
+ {{- end -}}
+
+ {{- if gt (len .FmtCurrencyNegativeSuffix) 0}}
+ b = append(b, {{ .BaseLocale }}.currencyNegativeSuffix...)
+ {{- end -}}
+
+ {{- if and (not .FmtCurrencyNegativeInPrefix) (not .FmtCurrencyNegativeLeft) }}
+ b = append(b, symbol...)
+ {{- end -}}
+ {{ if or (not .FmtCurrencyInPrefix) (gt (len .FmtCurrencySuffix) 0)}}
+ } else {
+ {{ end }}
+ {{- if and (not .FmtCurrencyInPrefix) .FmtCurrencyLeft }}
+ b = append(b, symbol...)
+ {{- end -}}
+
+ {{- if gt (len .FmtCurrencySuffix) 0}}
+ b = append(b, {{ .BaseLocale }}.currencyPositiveSuffix...)
+ {{- end -}}
+
+ {{- if and (not .FmtCurrencyInPrefix) (not .FmtCurrencyLeft) }}
+ b = append(b, symbol...)
+ {{- end -}}
+ {{- if or (not .FmtCurrencyNegativeInPrefix) (gt (len .FmtCurrencyNegativeSuffix) 0)}}
+ }
+ {{- end }}
+
+ return string(b)
+ {{ else }}
+ return string(append(append([]byte{}, symbol...), s...))
+ {{ end -}}
+}
+
+// FmtDateShort returns the short date representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtDateShort }}
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtDateMedium }}
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtDateLong }}
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtDateFull }}
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtTimeShort }}
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtTimeMedium }}
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtTimeLong }}
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for '{{ .Locale }}'
+func({{ .BaseLocale }} *{{ .Locale }}) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ {{ .FmtTimeFull }}
+
+ return string(b)
+}
+
+{{ end }}
diff --git a/vendor/github.com/go-playground/locales/cs/cs.go b/vendor/github.com/go-playground/locales/cs/cs.go
new file mode 100644
index 000000000..d8602f6cd
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cs/cs.go
@@ -0,0 +1,635 @@
+package cs
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cs struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cs' locale
+func New() locales.Translator {
+ return &cs{
+ locale: "cs",
+ pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "Kčs", "CUC", "CUP", "CVE", "CYP", "Kč", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "ECU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince"},
+ daysAbbreviated: []string{"ne", "po", "út", "st", "čt", "pá", "so"},
+ daysNarrow: []string{"N", "P", "Ú", "S", "Č", "P", "S"},
+ daysShort: []string{"ne", "po", "út", "st", "čt", "pá", "so"},
+ daysWide: []string{"neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"},
+ periodsAbbreviated: []string{"dop.", "odp."},
+ periodsNarrow: []string{"dop.", "odp."},
+ periodsWide: []string{"dop.", "odp."},
+ erasAbbreviated: []string{"př. n. l.", "n. l."},
+ erasNarrow: []string{"př.n.l.", "n.l."},
+ erasWide: []string{"před naším letopočtem", "našeho letopočtu"},
+ timezones: map[string]string{"HEPM": "Pierre-miquelonský letní čas", "CLST": "Chilský letní čas", "WAST": "Západoafrický letní čas", "LHDT": "Letní čas ostrova lorda Howa", "COT": "Kolumbijský standardní čas", "MESZ": "Středoevropský letní čas", "SRT": "Surinamský čas", "GFT": "Francouzskoguyanský čas", "HENOMX": "Severozápadní mexický letní čas", "CDT": "Severoamerický centrální letní čas", "WEZ": "Západoevropský standardní čas", "WITA": "Středoindonéský čas", "HNT": "Newfoundlandský standardní čas", "COST": "Kolumbijský letní čas", "OESZ": "Východoevropský letní čas", "HNCU": "Kubánský standardní čas", "MST": "Severoamerický horský standardní čas", "BT": "Bhútánský čas", "HKST": "Hongkongský letní čas", "UYST": "Uruguayský letní čas", "GMT": "Greenwichský střední čas", "SAST": "Jihoafrický čas", "NZDT": "Novozélandský letní čas", "SGT": "Singapurský čas", "ACDT": "Středoaustralský letní čas", "HNNOMX": "Severozápadní mexický standardní čas", "HADT": "Havajsko-aleutský letní čas", "ART": "Argentinský standardní čas", "ADT": "Atlantický letní čas", "BOT": "Bolivijský čas", "MDT": "Severoamerický horský letní čas", "AWDT": "Západoaustralský letní čas", "AEST": "Východoaustralský standardní čas", "NZST": "Novozélandský standardní čas", "HNOG": "Západogrónský standardní čas", "VET": "Venezuelský čas", "WIT": "Východoindonéský čas", "HAST": "Havajsko-aleutský standardní čas", "PST": "Severoamerický pacifický standardní čas", "AST": "Atlantický standardní čas", "ECT": "Ekvádorský čas", "AKST": "Aljašský standardní čas", "ACST": "Středoaustralský standardní čas", "LHST": "Standardní čas ostrova lorda Howa", "CLT": "Chilský standardní čas", "TMST": "Turkmenský letní čas", "HEPMX": "Mexický pacifický letní čas", "JST": "Japonský standardní čas", "CAT": "Středoafrický čas", "UYT": "Uruguayský standardní čas", "TMT": "Turkmenský standardní čas", "HNEG": "Východogrónský standardní čas", "HEEG": "Východogrónský letní čas", "MYT": "Malajský čas", "HKT": "Hongkongský standardní čas", "ARST": "Argentinský letní čas", "ChST": "Chamorrský čas", "PDT": "Severoamerický pacifický letní čas", "WIB": "Západoindonéský čas", "OEZ": "Východoevropský standardní čas", "CHAST": "Chathamský standardní čas", "HEOG": "Západogrónský letní čas", "WART": "Západoargentinský standardní čas", "GYT": "Guyanský čas", "HECU": "Kubánský letní čas", "CHADT": "Chathamský letní čas", "AEDT": "Východoaustralský letní čas", "WESZ": "Západoevropský letní čas", "MEZ": "Středoevropský standardní čas", "IST": "Indický čas", "HAT": "Newfoundlandský letní čas", "CST": "Severoamerický centrální standardní čas", "JDT": "Japonský letní čas", "AKDT": "Aljašský letní čas", "ACWST": "Středozápadní australský standardní čas", "EDT": "Severoamerický východní letní čas", "AWST": "Západoaustralský standardní čas", "∅∅∅": "Acrejský letní čas", "ACWDT": "Středozápadní australský letní čas", "EST": "Severoamerický východní standardní čas", "WARST": "Západoargentinský letní čas", "HNPM": "Pierre-miquelonský standardní čas", "EAT": "Východoafrický čas", "HNPMX": "Mexický pacifický standardní čas", "WAT": "Západoafrický standardní čas"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cs *cs) Locale() string {
+ return cs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cs'
+func (cs *cs) PluralsCardinal() []locales.PluralRule {
+ return cs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cs'
+func (cs *cs) PluralsOrdinal() []locales.PluralRule {
+ return cs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cs'
+func (cs *cs) PluralsRange() []locales.PluralRule {
+ return cs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cs'
+func (cs *cs) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ } else if i >= 2 && i <= 4 && v == 0 {
+ return locales.PluralRuleFew
+ } else if v != 0 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cs'
+func (cs *cs) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cs'
+func (cs *cs) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := cs.CardinalPluralRule(num1, v1)
+ end := cs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cs *cs) MonthAbbreviated(month time.Month) string {
+ return cs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cs *cs) MonthsAbbreviated() []string {
+ return cs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cs *cs) MonthNarrow(month time.Month) string {
+ return cs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cs *cs) MonthsNarrow() []string {
+ return cs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cs *cs) MonthWide(month time.Month) string {
+ return cs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cs *cs) MonthsWide() []string {
+ return cs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cs *cs) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cs *cs) WeekdaysAbbreviated() []string {
+ return cs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cs *cs) WeekdayNarrow(weekday time.Weekday) string {
+ return cs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cs *cs) WeekdaysNarrow() []string {
+ return cs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cs *cs) WeekdayShort(weekday time.Weekday) string {
+ return cs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cs *cs) WeekdaysShort() []string {
+ return cs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cs *cs) WeekdayWide(weekday time.Weekday) string {
+ return cs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cs *cs) WeekdaysWide() []string {
+ return cs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cs *cs) Decimal() string {
+ return cs.decimal
+}
+
+// Group returns the group of number
+func (cs *cs) Group() string {
+ return cs.group
+}
+
+// Group returns the minus sign of number
+func (cs *cs) Minus() string {
+ return cs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cs' and handles both Whole and Real numbers based on 'v'
+func (cs *cs) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cs' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cs *cs) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cs.percentSuffix...)
+
+ b = append(b, cs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cs'
+func (cs *cs) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, cs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cs'
+// in accounting notation.
+func (cs *cs) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, cs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, cs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cs'
+func (cs *cs) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cs'
+func (cs *cs) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cs'
+func (cs *cs) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, cs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cs'
+func (cs *cs) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, cs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cs'
+func (cs *cs) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cs'
+func (cs *cs) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cs'
+func (cs *cs) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cs'
+func (cs *cs) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cs/cs_test.go b/vendor/github.com/go-playground/locales/cs/cs_test.go
new file mode 100644
index 000000000..77c1bb916
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cs/cs_test.go
@@ -0,0 +1,1120 @@
+package cs
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cs"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ.go b/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ.go
new file mode 100644
index 000000000..aaf761f5b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ.go
@@ -0,0 +1,635 @@
+package cs_CZ
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cs_CZ struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cs_CZ' locale
+func New() locales.Translator {
+ return &cs_CZ{
+ locale: "cs_CZ",
+ pluralsCardinal: []locales.PluralRule{2, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 4, 5, 6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "led", "úno", "bře", "dub", "kvě", "čvn", "čvc", "srp", "zář", "říj", "lis", "pro"},
+ monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
+ monthsWide: []string{"", "ledna", "února", "března", "dubna", "května", "června", "července", "srpna", "září", "října", "listopadu", "prosince"},
+ daysAbbreviated: []string{"ne", "po", "út", "st", "čt", "pá", "so"},
+ daysNarrow: []string{"N", "P", "Ú", "S", "Č", "P", "S"},
+ daysShort: []string{"ne", "po", "út", "st", "čt", "pá", "so"},
+ daysWide: []string{"neděle", "pondělí", "úterý", "středa", "čtvrtek", "pátek", "sobota"},
+ periodsAbbreviated: []string{"dop.", "odp."},
+ periodsNarrow: []string{"dop.", "odp."},
+ periodsWide: []string{"dop.", "odp."},
+ erasAbbreviated: []string{"př. n. l.", "n. l."},
+ erasNarrow: []string{"př.n.l.", "n.l."},
+ erasWide: []string{"před naším letopočtem", "našeho letopočtu"},
+ timezones: map[string]string{"∅∅∅": "Azorský letní čas", "TMT": "Turkmenský standardní čas", "MYT": "Malajský čas", "BT": "Bhútánský čas", "COST": "Kolumbijský letní čas", "GYT": "Guyanský čas", "ACST": "Středoaustralský standardní čas", "EDT": "Severoamerický východní letní čas", "MESZ": "Středoevropský letní čas", "VET": "Venezuelský čas", "WIT": "Východoindonéský čas", "ARST": "Argentinský letní čas", "CHAST": "Chathamský standardní čas", "AWST": "Západoaustralský standardní čas", "AST": "Atlantický standardní čas", "HNEG": "Východogrónský standardní čas", "WITA": "Středoindonéský čas", "CLT": "Chilský standardní čas", "ChST": "Chamorrský čas", "HECU": "Kubánský letní čas", "NZST": "Novozélandský standardní čas", "WAT": "Západoafrický standardní čas", "WAST": "Západoafrický letní čas", "HAST": "Havajsko-aleutský standardní čas", "OEZ": "Východoevropský standardní čas", "GMT": "Greenwichský střední čas", "HEPMX": "Mexický pacifický letní čas", "CST": "Severoamerický centrální standardní čas", "AEDT": "Východoaustralský letní čas", "ART": "Argentinský standardní čas", "ADT": "Atlantický letní čas", "SGT": "Singapurský čas", "OESZ": "Východoevropský letní čas", "HNCU": "Kubánský standardní čas", "WEZ": "Západoevropský standardní čas", "ECT": "Ekvádorský čas", "AKST": "Aljašský standardní čas", "ACWST": "Středozápadní australský standardní čas", "HEOG": "Západogrónský letní čas", "UYST": "Uruguayský letní čas", "SAST": "Jihoafrický čas", "AKDT": "Aljašský letní čas", "IST": "Indický čas", "SRT": "Surinamský čas", "PST": "Severoamerický pacifický standardní čas", "AWDT": "Západoaustralský letní čas", "BOT": "Bolivijský čas", "JDT": "Japonský letní čas", "ACDT": "Středoaustralský letní čas", "ACWDT": "Středozápadní australský letní čas", "HNOG": "Západogrónský standardní čas", "HNT": "Newfoundlandský standardní čas", "PDT": "Severoamerický pacifický letní čas", "HNPMX": "Mexický pacifický standardní čas", "HEPM": "Pierre-miquelonský letní čas", "EAT": "Východoafrický čas", "CLST": "Chilský letní čas", "COT": "Kolumbijský standardní čas", "AEST": "Východoaustralský standardní čas", "JST": "Japonský standardní čas", "HKST": "Hongkongský letní čas", "MEZ": "Středoevropský standardní čas", "WARST": "Západoargentinský letní čas", "HADT": "Havajsko-aleutský letní čas", "GFT": "Francouzskoguyanský čas", "WART": "Západoargentinský standardní čas", "CDT": "Severoamerický centrální letní čas", "WESZ": "Západoevropský letní čas", "LHST": "Standardní čas ostrova lorda Howa", "HNPM": "Pierre-miquelonský standardní čas", "HAT": "Newfoundlandský letní čas", "TMST": "Turkmenský letní čas", "CAT": "Středoafrický čas", "HEEG": "Východogrónský letní čas", "LHDT": "Letní čas ostrova lorda Howa", "MDT": "Macajský letní čas", "WIB": "Západoindonéský čas", "EST": "Severoamerický východní standardní čas", "HNNOMX": "Severozápadní mexický standardní čas", "MST": "Macajský standardní čas", "NZDT": "Novozélandský letní čas", "HKT": "Hongkongský standardní čas", "HENOMX": "Severozápadní mexický letní čas", "UYT": "Uruguayský standardní čas", "CHADT": "Chathamský letní čas"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cs *cs_CZ) Locale() string {
+ return cs.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cs_CZ'
+func (cs *cs_CZ) PluralsCardinal() []locales.PluralRule {
+ return cs.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cs_CZ'
+func (cs *cs_CZ) PluralsOrdinal() []locales.PluralRule {
+ return cs.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cs_CZ'
+func (cs *cs_CZ) PluralsRange() []locales.PluralRule {
+ return cs.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cs_CZ'
+func (cs *cs_CZ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ } else if i >= 2 && i <= 4 && v == 0 {
+ return locales.PluralRuleFew
+ } else if v != 0 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cs_CZ'
+func (cs *cs_CZ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cs_CZ'
+func (cs *cs_CZ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := cs.CardinalPluralRule(num1, v1)
+ end := cs.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cs *cs_CZ) MonthAbbreviated(month time.Month) string {
+ return cs.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cs *cs_CZ) MonthsAbbreviated() []string {
+ return cs.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cs *cs_CZ) MonthNarrow(month time.Month) string {
+ return cs.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cs *cs_CZ) MonthsNarrow() []string {
+ return cs.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cs *cs_CZ) MonthWide(month time.Month) string {
+ return cs.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cs *cs_CZ) MonthsWide() []string {
+ return cs.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cs *cs_CZ) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cs.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cs *cs_CZ) WeekdaysAbbreviated() []string {
+ return cs.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cs *cs_CZ) WeekdayNarrow(weekday time.Weekday) string {
+ return cs.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cs *cs_CZ) WeekdaysNarrow() []string {
+ return cs.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cs *cs_CZ) WeekdayShort(weekday time.Weekday) string {
+ return cs.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cs *cs_CZ) WeekdaysShort() []string {
+ return cs.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cs *cs_CZ) WeekdayWide(weekday time.Weekday) string {
+ return cs.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cs *cs_CZ) WeekdaysWide() []string {
+ return cs.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cs *cs_CZ) Decimal() string {
+ return cs.decimal
+}
+
+// Group returns the group of number
+func (cs *cs_CZ) Group() string {
+ return cs.group
+}
+
+// Group returns the minus sign of number
+func (cs *cs_CZ) Minus() string {
+ return cs.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cs_CZ' and handles both Whole and Real numbers based on 'v'
+func (cs *cs_CZ) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cs_CZ' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cs *cs_CZ) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cs.percentSuffix...)
+
+ b = append(b, cs.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cs_CZ'
+func (cs *cs_CZ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cs.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, cs.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cs_CZ'
+// in accounting notation.
+func (cs *cs_CZ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cs.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cs.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cs.group) - 1; j >= 0; j-- {
+ b = append(b, cs.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, cs.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cs.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cs.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, cs.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, cs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cs.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, cs.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cs_CZ'
+func (cs *cs_CZ) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cs.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cs.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ_test.go b/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ_test.go
new file mode 100644
index 000000000..9cec35fb7
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cs_CZ/cs_CZ_test.go
@@ -0,0 +1,1120 @@
+package cs_CZ
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cs_CZ"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cu/cu.go b/vendor/github.com/go-playground/locales/cu/cu.go
new file mode 100644
index 000000000..8c404042f
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cu/cu.go
@@ -0,0 +1,609 @@
+package cu
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cu struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cu' locale
+func New() locales.Translator {
+ return &cu{
+ locale: "cu",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "₸", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "₽", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "₴", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "і҆аⷩ҇", "феⷡ҇", "маⷬ҇", "а҆пⷬ҇", "маꙵ", "і҆ꙋⷩ҇", "і҆ꙋⷧ҇", "а҆́ѵⷢ҇", "сеⷫ҇", "ѻ҆кⷮ", "ноеⷨ", "деⷦ҇"},
+ monthsNarrow: []string{"", "І҆", "Ф", "М", "А҆", "М", "І҆", "І҆", "А҆", "С", "Ѻ҆", "Н", "Д"},
+ monthsWide: []string{"", "і҆аннꙋа́рїа", "феврꙋа́рїа", "ма́рта", "а҆прі́ллїа", "ма́їа", "і҆ꙋ́нїа", "і҆ꙋ́лїа", "а҆́ѵгꙋста", "септе́мврїа", "ѻ҆ктѡ́врїа", "ное́мврїа", "деке́мврїа"},
+ daysAbbreviated: []string{"ндⷧ҇ѧ", "пнⷣе", "втоⷬ҇", "срⷣе", "чеⷦ҇", "пѧⷦ҇", "сꙋⷠ҇"},
+ daysNarrow: []string{"Н", "П", "В", "С", "Ч", "П", "С"},
+ daysShort: []string{"ндⷧ҇ѧ", "пнⷣе", "втоⷬ҇", "срⷣе", "чеⷦ҇", "пѧⷦ҇", "сꙋⷠ҇"},
+ daysWide: []string{"недѣ́лѧ", "понедѣ́льникъ", "вто́рникъ", "среда̀", "четверто́къ", "пѧто́къ", "сꙋббѡ́та"},
+ periodsAbbreviated: []string{"ДП", "ПП"},
+ periodsNarrow: []string{"ДП", "ПП"},
+ periodsWide: []string{"ДП", "ПП"},
+ erasAbbreviated: []string{"пре́дъ р.\u00a0х.", "ѿ р. х."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
+ timezones: map[string]string{"NZDT": "NZDT", "WART": "WART", "MDT": "MDT", "SRT": "SRT", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "HEPMX": "HEPMX", "AWDT": "AWDT", "JDT": "JDT", "WARST": "WARST", "HNPMX": "HNPMX", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ", "BT": "BT", "AKDT": "AKDT", "ACWST": "ACWST", "HEPM": "HEPM", "AKST": "AKST", "HEOG": "HEOG", "CLT": "CLT", "UYT": "UYT", "AWST": "AWST", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "AEST": "AEST", "WIB": "WIB", "IST": "IST", "HNT": "HNT", "AEDT": "AEDT", "HEEG": "HEEG", "EAT": "EAT", "HNOG": "HNOG", "MST": "MST", "UYST": "UYST", "ECT": "ECT", "ACST": "ACST", "ACDT": "ACDT", "ACWDT": "ACWDT", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "WITA": "WITA", "HNPM": "HNPM", "WIT": "WIT", "TMST": "TMST", "CLST": "CLST", "COT": "COT", "HKT": "HKT", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "AST": "а҆тланті́ческое зи́мнее вре́мѧ", "WAT": "WAT", "MYT": "MYT", "HENOMX": "HENOMX", "CAT": "CAT", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "HNCU": "HNCU", "BOT": "BOT", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "LHDT": "LHDT", "HNEG": "HNEG", "LHST": "LHST", "COST": "COST", "CHADT": "CHADT", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "GFT": "GFT", "NZST": "NZST", "∅∅∅": "∅∅∅", "HADT": "HADT", "JST": "JST", "TMT": "TMT", "HECU": "HECU", "HKST": "HKST", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "HAT": "HAT", "HAST": "HAST", "ART": "ART", "ARST": "ARST", "GYT": "GYT", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "SGT": "SGT", "VET": "VET", "HNNOMX": "HNNOMX", "ChST": "ChST", "CHAST": "CHAST", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "SAST": "SAST", "WAST": "WAST", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cu *cu) Locale() string {
+ return cu.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cu'
+func (cu *cu) PluralsCardinal() []locales.PluralRule {
+ return cu.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cu'
+func (cu *cu) PluralsOrdinal() []locales.PluralRule {
+ return cu.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cu'
+func (cu *cu) PluralsRange() []locales.PluralRule {
+ return cu.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cu'
+func (cu *cu) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cu'
+func (cu *cu) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cu'
+func (cu *cu) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cu *cu) MonthAbbreviated(month time.Month) string {
+ return cu.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cu *cu) MonthsAbbreviated() []string {
+ return cu.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cu *cu) MonthNarrow(month time.Month) string {
+ return cu.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cu *cu) MonthsNarrow() []string {
+ return cu.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cu *cu) MonthWide(month time.Month) string {
+ return cu.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cu *cu) MonthsWide() []string {
+ return cu.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cu *cu) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cu.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cu *cu) WeekdaysAbbreviated() []string {
+ return cu.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cu *cu) WeekdayNarrow(weekday time.Weekday) string {
+ return cu.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cu *cu) WeekdaysNarrow() []string {
+ return cu.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cu *cu) WeekdayShort(weekday time.Weekday) string {
+ return cu.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cu *cu) WeekdaysShort() []string {
+ return cu.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cu *cu) WeekdayWide(weekday time.Weekday) string {
+ return cu.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cu *cu) WeekdaysWide() []string {
+ return cu.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cu *cu) Decimal() string {
+ return cu.decimal
+}
+
+// Group returns the group of number
+func (cu *cu) Group() string {
+ return cu.group
+}
+
+// Group returns the minus sign of number
+func (cu *cu) Minus() string {
+ return cu.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cu' and handles both Whole and Real numbers based on 'v'
+func (cu *cu) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cu' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cu *cu) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cu.percentSuffix...)
+
+ b = append(b, cu.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cu'
+func (cu *cu) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cu.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, cu.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cu'
+// in accounting notation.
+func (cu *cu) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cu.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, cu.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cu.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, cu.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cu'
+func (cu *cu) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cu'
+func (cu *cu) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cu'
+func (cu *cu) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cu'
+func (cu *cu) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cu.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xd0, 0xbb}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cu'
+func (cu *cu) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cu'
+func (cu *cu) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cu'
+func (cu *cu) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cu'
+func (cu *cu) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cu.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cu/cu_test.go b/vendor/github.com/go-playground/locales/cu/cu_test.go
new file mode 100644
index 000000000..91c734a40
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cu/cu_test.go
@@ -0,0 +1,1120 @@
+package cu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cu_RU/cu_RU.go b/vendor/github.com/go-playground/locales/cu_RU/cu_RU.go
new file mode 100644
index 000000000..1f4f4c2a2
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cu_RU/cu_RU.go
@@ -0,0 +1,609 @@
+package cu_RU
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cu_RU struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cu_RU' locale
+func New() locales.Translator {
+ return &cu_RU{
+ locale: "cu_RU",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "і҆аⷩ҇", "феⷡ҇", "маⷬ҇", "а҆пⷬ҇", "маꙵ", "і҆ꙋⷩ҇", "і҆ꙋⷧ҇", "а҆́ѵⷢ҇", "сеⷫ҇", "ѻ҆кⷮ", "ноеⷨ", "деⷦ҇"},
+ monthsNarrow: []string{"", "І҆", "Ф", "М", "А҆", "М", "І҆", "І҆", "А҆", "С", "Ѻ҆", "Н", "Д"},
+ monthsWide: []string{"", "і҆аннꙋа́рїа", "феврꙋа́рїа", "ма́рта", "а҆прі́ллїа", "ма́їа", "і҆ꙋ́нїа", "і҆ꙋ́лїа", "а҆́ѵгꙋста", "септе́мврїа", "ѻ҆ктѡ́врїа", "ное́мврїа", "деке́мврїа"},
+ daysAbbreviated: []string{"ндⷧ҇ѧ", "пнⷣе", "втоⷬ҇", "срⷣе", "чеⷦ҇", "пѧⷦ҇", "сꙋⷠ҇"},
+ daysNarrow: []string{"Н", "П", "В", "С", "Ч", "П", "С"},
+ daysShort: []string{"ндⷧ҇ѧ", "пнⷣе", "втоⷬ҇", "срⷣе", "чеⷦ҇", "пѧⷦ҇", "сꙋⷠ҇"},
+ daysWide: []string{"недѣ́лѧ", "понедѣ́льникъ", "вто́рникъ", "среда̀", "четверто́къ", "пѧто́къ", "сꙋббѡ́та"},
+ periodsAbbreviated: []string{"ДП", "ПП"},
+ periodsNarrow: []string{"ДП", "ПП"},
+ periodsWide: []string{"ДП", "ПП"},
+ erasAbbreviated: []string{"пре́дъ р.\u00a0х.", "ѿ р. х."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"пре́дъ р.\u00a0х.", "по р.\u00a0х."},
+ timezones: map[string]string{"NZDT": "NZDT", "MYT": "MYT", "HNNOMX": "HNNOMX", "AWST": "AWST", "WAST": "WAST", "JST": "JST", "AKDT": "AKDT", "ACDT": "ACDT", "COT": "COT", "UYT": "UYT", "MST": "а҆мерїка́нское наго́рнее зи́мнее вре́мѧ", "HNEG": "HNEG", "HNPM": "HNPM", "WITA": "WITA", "HNCU": "HNCU", "PST": "тихоѻкеа́нское зи́мнее вре́мѧ", "WIB": "WIB", "WART": "WART", "HNT": "HNT", "HENOMX": "HENOMX", "CLST": "CLST", "AWDT": "AWDT", "EDT": "восточноамерїка́нское лѣ́тнее вре́мѧ", "ACWDT": "ACWDT", "CHADT": "CHADT", "WESZ": "западноєѵрѡпе́йское лѣ́тнее вре́мѧ", "EST": "восточноамерїка́нское зи́мнее вре́мѧ", "LHST": "LHST", "OESZ": "восточноєѵрѡпе́йское лѣ́тнее вре́мѧ", "HAST": "HAST", "UYST": "UYST", "BOT": "BOT", "TMST": "TMST", "HEPMX": "HEPMX", "ADT": "а҆тланті́ческое лѣ́тнее вре́мѧ", "WEZ": "западноєѵрѡпе́йское зи́мнее вре́мѧ", "HKST": "HKST", "VET": "VET", "CDT": "среднеамерїка́нское лѣ́тнее вре́мѧ", "NZST": "NZST", "HEEG": "HEEG", "BT": "BT", "HEOG": "HEOG", "ART": "ART", "CHAST": "CHAST", "HNPMX": "HNPMX", "LHDT": "LHDT", "HEPM": "HEPM", "SRT": "SRT", "SAST": "SAST", "GFT": "GFT", "HNOG": "HNOG", "MESZ": "среднеєѵрѡпе́йское лѣ́тнее вре́мѧ", "WIT": "WIT", "GMT": "сре́днее вре́мѧ по грі́нꙋичꙋ", "AST": "а҆тланті́ческое зи́мнее вре́мѧ", "MDT": "а҆мерїка́нское наго́рнее лѣ́тнее вре́мѧ", "CAT": "CAT", "SGT": "SGT", "ACWST": "ACWST", "IST": "IST", "ChST": "ChST", "PDT": "тихоѻкеа́нское лѣ́тнее вре́мѧ", "JDT": "JDT", "AKST": "AKST", "ECT": "ECT", "OEZ": "восточноєѵрѡпе́йское зи́мнее вре́мѧ", "∅∅∅": "∅∅∅", "GYT": "GYT", "EAT": "EAT", "AEDT": "AEDT", "WARST": "WARST", "CLT": "CLT", "TMT": "TMT", "HADT": "HADT", "HECU": "HECU", "HAT": "HAT", "ACST": "ACST", "ARST": "ARST", "CST": "среднеамерїка́нское зи́мнее вре́мѧ", "AEST": "AEST", "HKT": "HKT", "COST": "COST", "WAT": "WAT", "MEZ": "среднеєѵрѡпе́йское зи́мнее вре́мѧ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cu *cu_RU) Locale() string {
+ return cu.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cu_RU'
+func (cu *cu_RU) PluralsCardinal() []locales.PluralRule {
+ return cu.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cu_RU'
+func (cu *cu_RU) PluralsOrdinal() []locales.PluralRule {
+ return cu.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cu_RU'
+func (cu *cu_RU) PluralsRange() []locales.PluralRule {
+ return cu.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cu_RU'
+func (cu *cu_RU) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cu_RU'
+func (cu *cu_RU) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cu_RU'
+func (cu *cu_RU) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cu *cu_RU) MonthAbbreviated(month time.Month) string {
+ return cu.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cu *cu_RU) MonthsAbbreviated() []string {
+ return cu.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cu *cu_RU) MonthNarrow(month time.Month) string {
+ return cu.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cu *cu_RU) MonthsNarrow() []string {
+ return cu.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cu *cu_RU) MonthWide(month time.Month) string {
+ return cu.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cu *cu_RU) MonthsWide() []string {
+ return cu.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cu *cu_RU) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cu.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cu *cu_RU) WeekdaysAbbreviated() []string {
+ return cu.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cu *cu_RU) WeekdayNarrow(weekday time.Weekday) string {
+ return cu.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cu *cu_RU) WeekdaysNarrow() []string {
+ return cu.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cu *cu_RU) WeekdayShort(weekday time.Weekday) string {
+ return cu.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cu *cu_RU) WeekdaysShort() []string {
+ return cu.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cu *cu_RU) WeekdayWide(weekday time.Weekday) string {
+ return cu.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cu *cu_RU) WeekdaysWide() []string {
+ return cu.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cu *cu_RU) Decimal() string {
+ return cu.decimal
+}
+
+// Group returns the group of number
+func (cu *cu_RU) Group() string {
+ return cu.group
+}
+
+// Group returns the minus sign of number
+func (cu *cu_RU) Minus() string {
+ return cu.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cu_RU' and handles both Whole and Real numbers based on 'v'
+func (cu *cu_RU) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cu_RU' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cu *cu_RU) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cu.percentSuffix...)
+
+ b = append(b, cu.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cu_RU'
+func (cu *cu_RU) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cu.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, cu.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cu_RU'
+// in accounting notation.
+func (cu *cu_RU) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cu.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(cu.group) - 1; j >= 0; j-- {
+ b = append(b, cu.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, cu.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cu.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, cu.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cu.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xd0, 0xbb}...)
+ b = append(b, []byte{0x2e, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2e}...)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cu_RU'
+func (cu *cu_RU) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cu.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cu_RU/cu_RU_test.go b/vendor/github.com/go-playground/locales/cu_RU/cu_RU_test.go
new file mode 100644
index 000000000..3f32150cd
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cu_RU/cu_RU_test.go
@@ -0,0 +1,1120 @@
+package cu_RU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cu_RU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/currency/currency.go b/vendor/github.com/go-playground/locales/currency/currency.go
new file mode 100644
index 000000000..cdaba596b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/currency/currency.go
@@ -0,0 +1,308 @@
+package currency
+
+// Type is the currency type associated with the locales currency enum
+type Type int
+
+// locale currencies
+const (
+ ADP Type = iota
+ AED
+ AFA
+ AFN
+ ALK
+ ALL
+ AMD
+ ANG
+ AOA
+ AOK
+ AON
+ AOR
+ ARA
+ ARL
+ ARM
+ ARP
+ ARS
+ ATS
+ AUD
+ AWG
+ AZM
+ AZN
+ BAD
+ BAM
+ BAN
+ BBD
+ BDT
+ BEC
+ BEF
+ BEL
+ BGL
+ BGM
+ BGN
+ BGO
+ BHD
+ BIF
+ BMD
+ BND
+ BOB
+ BOL
+ BOP
+ BOV
+ BRB
+ BRC
+ BRE
+ BRL
+ BRN
+ BRR
+ BRZ
+ BSD
+ BTN
+ BUK
+ BWP
+ BYB
+ BYN
+ BYR
+ BZD
+ CAD
+ CDF
+ CHE
+ CHF
+ CHW
+ CLE
+ CLF
+ CLP
+ CNH
+ CNX
+ CNY
+ COP
+ COU
+ CRC
+ CSD
+ CSK
+ CUC
+ CUP
+ CVE
+ CYP
+ CZK
+ DDM
+ DEM
+ DJF
+ DKK
+ DOP
+ DZD
+ ECS
+ ECV
+ EEK
+ EGP
+ ERN
+ ESA
+ ESB
+ ESP
+ ETB
+ EUR
+ FIM
+ FJD
+ FKP
+ FRF
+ GBP
+ GEK
+ GEL
+ GHC
+ GHS
+ GIP
+ GMD
+ GNF
+ GNS
+ GQE
+ GRD
+ GTQ
+ GWE
+ GWP
+ GYD
+ HKD
+ HNL
+ HRD
+ HRK
+ HTG
+ HUF
+ IDR
+ IEP
+ ILP
+ ILR
+ ILS
+ INR
+ IQD
+ IRR
+ ISJ
+ ISK
+ ITL
+ JMD
+ JOD
+ JPY
+ KES
+ KGS
+ KHR
+ KMF
+ KPW
+ KRH
+ KRO
+ KRW
+ KWD
+ KYD
+ KZT
+ LAK
+ LBP
+ LKR
+ LRD
+ LSL
+ LTL
+ LTT
+ LUC
+ LUF
+ LUL
+ LVL
+ LVR
+ LYD
+ MAD
+ MAF
+ MCF
+ MDC
+ MDL
+ MGA
+ MGF
+ MKD
+ MKN
+ MLF
+ MMK
+ MNT
+ MOP
+ MRO
+ MTL
+ MTP
+ MUR
+ MVP
+ MVR
+ MWK
+ MXN
+ MXP
+ MXV
+ MYR
+ MZE
+ MZM
+ MZN
+ NAD
+ NGN
+ NIC
+ NIO
+ NLG
+ NOK
+ NPR
+ NZD
+ OMR
+ PAB
+ PEI
+ PEN
+ PES
+ PGK
+ PHP
+ PKR
+ PLN
+ PLZ
+ PTE
+ PYG
+ QAR
+ RHD
+ ROL
+ RON
+ RSD
+ RUB
+ RUR
+ RWF
+ SAR
+ SBD
+ SCR
+ SDD
+ SDG
+ SDP
+ SEK
+ SGD
+ SHP
+ SIT
+ SKK
+ SLL
+ SOS
+ SRD
+ SRG
+ SSP
+ STD
+ STN
+ SUR
+ SVC
+ SYP
+ SZL
+ THB
+ TJR
+ TJS
+ TMM
+ TMT
+ TND
+ TOP
+ TPE
+ TRL
+ TRY
+ TTD
+ TWD
+ TZS
+ UAH
+ UAK
+ UGS
+ UGX
+ USD
+ USN
+ USS
+ UYI
+ UYP
+ UYU
+ UZS
+ VEB
+ VEF
+ VND
+ VNN
+ VUV
+ WST
+ XAF
+ XAG
+ XAU
+ XBA
+ XBB
+ XBC
+ XBD
+ XCD
+ XDR
+ XEU
+ XFO
+ XFU
+ XOF
+ XPD
+ XPF
+ XPT
+ XRE
+ XSU
+ XTS
+ XUA
+ XXX
+ YDD
+ YER
+ YUD
+ YUM
+ YUN
+ YUR
+ ZAL
+ ZAR
+ ZMK
+ ZMW
+ ZRN
+ ZRZ
+ ZWD
+ ZWL
+ ZWR
+)
diff --git a/vendor/github.com/go-playground/locales/cy/cy.go b/vendor/github.com/go-playground/locales/cy/cy.go
new file mode 100644
index 000000000..a9f536e40
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cy/cy.go
@@ -0,0 +1,676 @@
+package cy
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cy struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cy' locale
+func New() locales.Translator {
+ return &cy{
+ locale: "cy",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 3, 4, 5, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "A$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Ion", "Chwef", "Maw", "Ebrill", "Mai", "Meh", "Gorff", "Awst", "Medi", "Hyd", "Tach", "Rhag"},
+ monthsNarrow: []string{"", "I", "Ch", "M", "E", "M", "M", "G", "A", "M", "H", "T", "Rh"},
+ monthsWide: []string{"", "Ionawr", "Chwefror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorffennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"},
+ daysAbbreviated: []string{"Sul", "Llun", "Maw", "Mer", "Iau", "Gwen", "Sad"},
+ daysNarrow: []string{"S", "Ll", "M", "M", "I", "G", "S"},
+ daysShort: []string{"Su", "Ll", "Ma", "Me", "Ia", "Gw", "Sa"},
+ daysWide: []string{"Dydd Sul", "Dydd Llun", "Dydd Mawrth", "Dydd Mercher", "Dydd Iau", "Dydd Gwener", "Dydd Sadwrn"},
+ periodsAbbreviated: []string{"yb", "yh"},
+ periodsNarrow: []string{"b", "h"},
+ periodsWide: []string{"yb", "yh"},
+ erasAbbreviated: []string{"CC", "OC"},
+ erasNarrow: []string{"C", "O"},
+ erasWide: []string{"Cyn Crist", "Oed Crist"},
+ timezones: map[string]string{"WART": "Amser Safonol Gorllewin Ariannin", "EAT": "Amser Dwyrain Affrica", "OESZ": "Amser Haf Dwyrain Ewrop", "WAT": "Amser Safonol Gorllewin Affrica", "AKST": "Amser Safonol Alaska", "ACST": "Amser Safonol Canolbarth Awstralia", "HNT": "Amser Safonol Newfoundland", "CLT": "Amser Safonol Chile", "HADT": "Amser Haf Hawaii-Aleutian", "OEZ": "Amser Safonol Dwyrain Ewrop", "UYT": "Amser Safonol Uruguay", "MYT": "Amser Malaysia", "BT": "Amser Bhutan", "WAST": "Amser Haf Gorllewin Affrica", "WIB": "Amser Gorllewin Indonesia", "BOT": "Amser Bolivia", "HNPM": "Amser Safonol Saint-Pierre-et-Miquelon", "HEPMX": "Amser Haf Pasiffig Mecsico", "AST": "Amser Safonol Cefnfor yr Iwerydd", "AEST": "Amser Safonol Dwyrain Awstralia", "SGT": "Amser Singapore", "ECT": "Amser Ecuador", "IST": "Amser India", "HNNOMX": "Amser Safonol Gogledd Orllewin Mecsico", "TMST": "Amser Haf Tyrcmenistan", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "CDT": "Amser Haf Canolbarth Gogledd America", "HAST": "Amser Safonol Hawaii-Aleutian", "GFT": "Amser Guyane Ffrengig", "HAT": "Amser Haf Newfoundland", "CHADT": "Amser Haf Chatham", "NZDT": "Amser Haf Seland Newydd", "NZST": "Amser Safonol Seland Newydd", "UYST": "Amser Haf Uruguay", "WESZ": "Amser Haf Gorllewin Ewrop", "JDT": "Amser Haf Siapan", "EDT": "Amser Haf Dwyrain Gogledd America", "HENOMX": "Amser Haf Gogledd Orllewin Mecsico", "SRT": "Amser Suriname", "ART": "Amser Safonol Ariannin", "HNCU": "Amser Safonol Cuba", "HECU": "Amser Haf Cuba", "ARST": "Amser Haf Ariannin", "COST": "Amser Haf Colombia", "WITA": "Amser Canolbarth Indonesia", "HNPMX": "Amser Safonol Pasiffig Mecsico", "ADT": "Amser Haf Cefnfor yr Iwerydd", "JST": "Amser Safonol Siapan", "MEZ": "Amser Safonol Canolbarth Ewrop", "MESZ": "Amser Haf Canolbarth Ewrop", "CLST": "Amser Haf Chile", "GMT": "Amser Safonol Greenwich", "MDT": "Amser Haf Mynyddoedd Gogledd America", "SAST": "Amser Safonol De Affrica", "HNEG": "Amser Safonol Dwyrain yr Ynys Las", "HNOG": "Amser Safonol Gorllewin yr Ynys Las", "HKT": "Amser Safonol Hong Kong", "LHDT": "Amser Haf yr Arglwydd Howe", "WIT": "Amser Dwyrain Indonesia", "COT": "Amser Safonol Colombia", "ChST": "Amser Chamorro", "∅∅∅": "Amser Haf Brasília", "AKDT": "Amser Haf Alaska", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "EST": "Amser Safonol Dwyrain Gogledd America", "LHST": "Amser Safonol yr Arglwydd Howe", "WARST": "Amser Haf Gorllewin Ariannin", "AWDT": "Amser Haf Gorllewin Awstralia", "CST": "Amser Safonol Canolbarth Gogledd America", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "VET": "Amser Venezuela", "HEPM": "Amser Haf Saint-Pierre-et-Miquelon", "CHAST": "Amser Safonol Chatham", "AWST": "Amser Safonol Gorllewin Awstralia", "ACDT": "Amser Haf Canolbarth Awstralia", "HKST": "Amser Haf Hong Kong", "GYT": "Amser Guyana", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "WEZ": "Amser Safonol Gorllewin Ewrop", "MST": "Amser Safonol Mynyddoedd Gogledd America", "CAT": "Amser Canolbarth Affrica", "HEOG": "Amser Haf Gorllewin yr Ynys Las", "TMT": "Amser Safonol Tyrcmenistan", "AEDT": "Amser Haf Dwyrain Awstralia", "HEEG": "Amser Haf Dwyrain yr Ynys Las"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cy *cy) Locale() string {
+ return cy.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cy'
+func (cy *cy) PluralsCardinal() []locales.PluralRule {
+ return cy.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cy'
+func (cy *cy) PluralsOrdinal() []locales.PluralRule {
+ return cy.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cy'
+func (cy *cy) PluralsRange() []locales.PluralRule {
+ return cy.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cy'
+func (cy *cy) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 3 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cy'
+func (cy *cy) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 0 || n == 7 || n == 8 || n == 9 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 3 || n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 5 || n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cy'
+func (cy *cy) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := cy.CardinalPluralRule(num1, v1)
+ end := cy.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cy *cy) MonthAbbreviated(month time.Month) string {
+ return cy.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cy *cy) MonthsAbbreviated() []string {
+ return cy.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cy *cy) MonthNarrow(month time.Month) string {
+ return cy.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cy *cy) MonthsNarrow() []string {
+ return cy.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cy *cy) MonthWide(month time.Month) string {
+ return cy.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cy *cy) MonthsWide() []string {
+ return cy.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cy *cy) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cy.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cy *cy) WeekdaysAbbreviated() []string {
+ return cy.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cy *cy) WeekdayNarrow(weekday time.Weekday) string {
+ return cy.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cy *cy) WeekdaysNarrow() []string {
+ return cy.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cy *cy) WeekdayShort(weekday time.Weekday) string {
+ return cy.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cy *cy) WeekdaysShort() []string {
+ return cy.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cy *cy) WeekdayWide(weekday time.Weekday) string {
+ return cy.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cy *cy) WeekdaysWide() []string {
+ return cy.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cy *cy) Decimal() string {
+ return cy.decimal
+}
+
+// Group returns the group of number
+func (cy *cy) Group() string {
+ return cy.group
+}
+
+// Group returns the minus sign of number
+func (cy *cy) Minus() string {
+ return cy.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cy' and handles both Whole and Real numbers based on 'v'
+func (cy *cy) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cy' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cy *cy) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cy.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cy'
+func (cy *cy) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cy.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cy.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cy'
+// in accounting notation.
+func (cy *cy) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cy.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, cy.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cy.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cy.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cy'
+func (cy *cy) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cy'
+func (cy *cy) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cy'
+func (cy *cy) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cy'
+func (cy *cy) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cy.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cy'
+func (cy *cy) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cy'
+func (cy *cy) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cy'
+func (cy *cy) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cy'
+func (cy *cy) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cy.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cy/cy_test.go b/vendor/github.com/go-playground/locales/cy/cy_test.go
new file mode 100644
index 000000000..feda64d4d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cy/cy_test.go
@@ -0,0 +1,1120 @@
+package cy
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cy"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/cy_GB/cy_GB.go b/vendor/github.com/go-playground/locales/cy_GB/cy_GB.go
new file mode 100644
index 000000000..e126f6676
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cy_GB/cy_GB.go
@@ -0,0 +1,676 @@
+package cy_GB
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type cy_GB struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'cy_GB' locale
+func New() locales.Translator {
+ return &cy_GB{
+ locale: "cy_GB",
+ pluralsCardinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsOrdinal: []locales.PluralRule{1, 2, 3, 4, 5, 6},
+ pluralsRange: []locales.PluralRule{2, 3, 4, 5, 6},
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Ion", "Chwef", "Maw", "Ebrill", "Mai", "Meh", "Gorff", "Awst", "Medi", "Hyd", "Tach", "Rhag"},
+ monthsNarrow: []string{"", "I", "Ch", "M", "E", "M", "M", "G", "A", "M", "H", "T", "Rh"},
+ monthsWide: []string{"", "Ionawr", "Chwefror", "Mawrth", "Ebrill", "Mai", "Mehefin", "Gorffennaf", "Awst", "Medi", "Hydref", "Tachwedd", "Rhagfyr"},
+ daysAbbreviated: []string{"Sul", "Llun", "Maw", "Mer", "Iau", "Gwen", "Sad"},
+ daysNarrow: []string{"S", "Ll", "M", "M", "I", "G", "S"},
+ daysShort: []string{"Su", "Ll", "Ma", "Me", "Ia", "Gw", "Sa"},
+ daysWide: []string{"Dydd Sul", "Dydd Llun", "Dydd Mawrth", "Dydd Mercher", "Dydd Iau", "Dydd Gwener", "Dydd Sadwrn"},
+ periodsAbbreviated: []string{"yb", "yh"},
+ periodsNarrow: []string{"b", "h"},
+ periodsWide: []string{"yb", "yh"},
+ erasAbbreviated: []string{"CC", "OC"},
+ erasNarrow: []string{"C", "O"},
+ erasWide: []string{"Cyn Crist", "Oed Crist"},
+ timezones: map[string]string{"MDT": "Amser Haf Mynyddoedd Gogledd America", "HEOG": "Amser Haf Gorllewin yr Ynys Las", "HNT": "Amser Safonol Newfoundland", "OESZ": "Amser Haf Dwyrain Ewrop", "HECU": "Amser Haf Cuba", "HEEG": "Amser Haf Dwyrain yr Ynys Las", "ART": "Amser Safonol Ariannin", "LHDT": "Amser Haf yr Arglwydd Howe", "EAT": "Amser Dwyrain Affrica", "HADT": "Amser Haf Hawaii-Aleutian", "CST": "Amser Safonol Canolbarth Gogledd America", "WAST": "Amser Haf Gorllewin Affrica", "SAST": "Amser Safonol De Affrica", "MYT": "Amser Malaysia", "HKST": "Amser Haf Hong Kong", "COT": "Amser Safonol Colombia", "GYT": "Amser Guyana", "CHAST": "Amser Safonol Chatham", "CHADT": "Amser Haf Chatham", "MEZ": "Amser Safonol Canolbarth Ewrop", "LHST": "Amser Safonol yr Arglwydd Howe", "WART": "Amser Safonol Gorllewin Ariannin", "UYST": "Amser Haf Uruguay", "CLT": "Amser Safonol Chile", "HAST": "Amser Safonol Hawaii-Aleutian", "ACWDT": "Amser Haf Canolbarth Gorllewin Awstralia", "HKT": "Amser Safonol Hong Kong", "WARST": "Amser Haf Gorllewin Ariannin", "VET": "Amser Venezuela", "SRT": "Amser Suriname", "IST": "Amser India", "HNPM": "Amser Safonol Saint-Pierre-et-Miquelon", "ChST": "Amser Chamorro", "PDT": "Amser Haf Cefnfor Tawel Gogledd America", "AWDT": "Amser Haf Gorllewin Awstralia", "HEPMX": "Amser Haf Pasiffig Mecsico", "ACWST": "Amser Safonol Canolbarth Gorllewin Awstralia", "MESZ": "Amser Haf Canolbarth Ewrop", "HNCU": "Amser Safonol Cuba", "ADT": "Amser Haf Cefnfor yr Iwerydd", "WAT": "Amser Safonol Gorllewin Affrica", "HEPM": "Amser Haf Saint-Pierre-et-Miquelon", "HNNOMX": "Amser Safonol Gogledd Orllewin Mecsico", "OEZ": "Amser Safonol Dwyrain Ewrop", "HENOMX": "Amser Haf Gogledd Orllewin Mecsico", "AWST": "Amser Safonol Gorllewin Awstralia", "WESZ": "Amser Haf Gorllewin Ewrop", "∅∅∅": "∅∅∅", "GFT": "Amser Guyane Ffrengig", "HNOG": "Amser Safonol Gorllewin yr Ynys Las", "CDT": "Amser Haf Canolbarth Gogledd America", "SGT": "Amser Singapore", "HAT": "Amser Haf Newfoundland", "COST": "Amser Haf Colombia", "JDT": "Amser Haf Siapan", "AKDT": "Amser Haf Alaska", "WITA": "Amser Canolbarth Indonesia", "CLST": "Amser Haf Chile", "WIT": "Amser Dwyrain Indonesia", "PST": "Amser Safonol Cefnfor Tawel Gogledd America", "BOT": "Amser Bolivia", "TMST": "Amser Haf Tyrcmenistan", "GMT": "Amser Safonol Greenwich", "HNPMX": "Amser Safonol Pasiffig Mecsico", "AEDT": "Amser Haf Dwyrain Awstralia", "AST": "Amser Safonol Cefnfor yr Iwerydd", "CAT": "Amser Canolbarth Affrica", "WEZ": "Amser Safonol Gorllewin Ewrop", "BT": "Amser Bhutan", "ACDT": "Amser Haf Canolbarth Awstralia", "HNEG": "Amser Safonol Dwyrain yr Ynys Las", "EST": "Amser Safonol Dwyrain Gogledd America", "MST": "Amser Safonol Mynyddoedd Gogledd America", "WIB": "Amser Gorllewin Indonesia", "AKST": "Amser Safonol Alaska", "ARST": "Amser Haf Ariannin", "UYT": "Amser Safonol Uruguay", "JST": "Amser Safonol Siapan", "ACST": "Amser Safonol Canolbarth Awstralia", "TMT": "Amser Safonol Tyrcmenistan", "AEST": "Amser Safonol Dwyrain Awstralia", "NZST": "Amser Safonol Seland Newydd", "NZDT": "Amser Haf Seland Newydd", "ECT": "Amser Ecuador", "EDT": "Amser Haf Dwyrain Gogledd America"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (cy *cy_GB) Locale() string {
+ return cy.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'cy_GB'
+func (cy *cy_GB) PluralsCardinal() []locales.PluralRule {
+ return cy.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'cy_GB'
+func (cy *cy_GB) PluralsOrdinal() []locales.PluralRule {
+ return cy.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'cy_GB'
+func (cy *cy_GB) PluralsRange() []locales.PluralRule {
+ return cy.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cy_GB'
+func (cy *cy_GB) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 0 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 3 {
+ return locales.PluralRuleFew
+ } else if n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'cy_GB'
+func (cy *cy_GB) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 0 || n == 7 || n == 8 || n == 9 {
+ return locales.PluralRuleZero
+ } else if n == 1 {
+ return locales.PluralRuleOne
+ } else if n == 2 {
+ return locales.PluralRuleTwo
+ } else if n == 3 || n == 4 {
+ return locales.PluralRuleFew
+ } else if n == 5 || n == 6 {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'cy_GB'
+func (cy *cy_GB) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := cy.CardinalPluralRule(num1, v1)
+ end := cy.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleZero && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleZero && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleTwo && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleTwo {
+ return locales.PluralRuleTwo
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
+ return locales.PluralRuleFew
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
+ return locales.PluralRuleMany
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (cy *cy_GB) MonthAbbreviated(month time.Month) string {
+ return cy.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (cy *cy_GB) MonthsAbbreviated() []string {
+ return cy.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (cy *cy_GB) MonthNarrow(month time.Month) string {
+ return cy.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (cy *cy_GB) MonthsNarrow() []string {
+ return cy.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (cy *cy_GB) MonthWide(month time.Month) string {
+ return cy.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (cy *cy_GB) MonthsWide() []string {
+ return cy.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (cy *cy_GB) WeekdayAbbreviated(weekday time.Weekday) string {
+ return cy.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (cy *cy_GB) WeekdaysAbbreviated() []string {
+ return cy.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (cy *cy_GB) WeekdayNarrow(weekday time.Weekday) string {
+ return cy.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (cy *cy_GB) WeekdaysNarrow() []string {
+ return cy.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (cy *cy_GB) WeekdayShort(weekday time.Weekday) string {
+ return cy.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (cy *cy_GB) WeekdaysShort() []string {
+ return cy.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (cy *cy_GB) WeekdayWide(weekday time.Weekday) string {
+ return cy.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (cy *cy_GB) WeekdaysWide() []string {
+ return cy.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (cy *cy_GB) Decimal() string {
+ return cy.decimal
+}
+
+// Group returns the group of number
+func (cy *cy_GB) Group() string {
+ return cy.group
+}
+
+// Group returns the minus sign of number
+func (cy *cy_GB) Minus() string {
+ return cy.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'cy_GB' and handles both Whole and Real numbers based on 'v'
+func (cy *cy_GB) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'cy_GB' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (cy *cy_GB) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, cy.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'cy_GB'
+func (cy *cy_GB) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cy.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, cy.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cy.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cy_GB'
+// in accounting notation.
+func (cy *cy_GB) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := cy.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, cy.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, cy.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, cy.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, cy.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, cy.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, cy.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, cy.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'cy_GB'
+func (cy *cy_GB) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, cy.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := cy.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/cy_GB/cy_GB_test.go b/vendor/github.com/go-playground/locales/cy_GB/cy_GB_test.go
new file mode 100644
index 000000000..2689e07ea
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/cy_GB/cy_GB_test.go
@@ -0,0 +1,1120 @@
+package cy_GB
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "cy_GB"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/da/da.go b/vendor/github.com/go-playground/locales/da/da.go
new file mode 100644
index 000000000..a105b7556
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da/da.go
@@ -0,0 +1,623 @@
+package da
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type da struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'da' locale
+func New() locales.Translator {
+ return &da{
+ locale: "da",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ".",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "kr.", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"},
+ daysAbbreviated: []string{"søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."},
+ daysNarrow: []string{"S", "M", "T", "O", "T", "F", "L"},
+ daysShort: []string{"sø", "ma", "ti", "on", "to", "fr", "lø"},
+ daysWide: []string{"søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"f.Kr.", "e.Kr."},
+ erasNarrow: []string{"fKr", "eKr"},
+ erasWide: []string{"f.Kr.", "e.Kr."},
+ timezones: map[string]string{"UYST": "Uruguayansk sommertid", "HEPMX": "Mexicansk Pacific-sommertid", "AKST": "Alaska-normaltid", "ACST": "Centralaustralsk normaltid", "MEZ": "Centraleuropæisk normaltid", "MESZ": "Centraleuropæisk sommertid", "WARST": "Vestargentinsk sommertid", "LHDT": "Lord Howe-sommertid", "SAST": "Sydafrikansk tid", "MYT": "Malaysia-tid", "SGT": "Singapore-tid", "MST": "Macao-normaltid", "WIT": "Østindonesisk tid", "TMST": "Turkmensk sommertid", "HADT": "Hawaii-Aleutian-sommertid", "ChST": "Chamorro-tid", "HNCU": "Cubansk normaltid", "HNPMX": "Mexicansk Pacific-normaltid", "CST": "Central-normaltid", "WART": "Vestargentinsk normaltid", "HNPM": "Saint Pierre- og Miquelon-normaltid", "CLST": "Chilensk sommertid", "HAST": "Hawaii-Aleutian-normaltid", "COST": "Colombiansk sommertid", "CHAST": "Chatham-normaltid", "PST": "Pacific-normaltid", "AEST": "Østaustralsk normaltid", "∅∅∅": "Azorerne-sommertid", "HNNOMX": "Nordvestmexicansk normaltid", "SRT": "Surinam-tid", "TMT": "Turkmensk normaltid", "WAT": "Vestafrikansk normaltid", "EDT": "Eastern-sommertid", "LHST": "Lord Howe-normaltid", "HNT": "Newfoundlandsk normaltid", "GYT": "Guyana-tid", "WEZ": "Vesteuropæisk normaltid", "ART": "Argentinsk normaltid", "WIB": "Vestindonesisk tid", "GFT": "Fransk Guyana-tid", "JST": "Japansk normaltid", "EAT": "Østafrikansk tid", "COT": "Colombiansk normaltid", "HEEG": "Østgrønlandsk sommertid", "HEOG": "Vestgrønlandsk sommertid", "CAT": "Centralafrikansk tid", "NZDT": "New Zealand-sommertid", "AEDT": "Østaustralsk sommertid", "ECT": "Ecuadoriansk tid", "HNEG": "Østgrønlandsk normaltid", "VET": "Venezuelansk tid", "OEZ": "Østeuropæisk normaltid", "AWDT": "Vestaustralsk sommertid", "AST": "Atlantic-normaltid", "HKST": "Hongkong-sommertid", "HAT": "Newfoundlandsk sommertid", "PDT": "Pacific-sommertid", "HNOG": "Vestgrønlandsk normaltid", "WAST": "Vestafrikansk sommertid", "EST": "Eastern-normaltid", "HENOMX": "Nordvestmexicansk sommertid", "MDT": "Macao-sommertid", "ARST": "Argentinsk sommertid", "WESZ": "Vesteuropæisk sommertid", "UYT": "Uruguayansk normaltid", "BOT": "Boliviansk tid", "JDT": "Japansk sommertid", "ACWST": "Vestlig centralaustralsk normaltid", "CDT": "Central-sommertid", "HKT": "Hongkong-normaltid", "IST": "Indien-normaltid", "HEPM": "Saint Pierre- og Miquelon-sommertid", "HECU": "Cubansk sommertid", "WITA": "Centralindonesisk tid", "GMT": "GMT", "ADT": "Atlantic-sommertid", "ACWDT": "Vestlig centralaustralsk sommertid", "OESZ": "Østeuropæisk sommertid", "AWST": "Vestaustralsk normaltid", "BT": "Bhutan-tid", "NZST": "New Zealand-normaltid", "CLT": "Chilensk normaltid", "CHADT": "Chatham-sommertid", "AKDT": "Alaska-sommertid", "ACDT": "Centralaustralsk sommertid"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (da *da) Locale() string {
+ return da.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'da'
+func (da *da) PluralsCardinal() []locales.PluralRule {
+ return da.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'da'
+func (da *da) PluralsOrdinal() []locales.PluralRule {
+ return da.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'da'
+func (da *da) PluralsRange() []locales.PluralRule {
+ return da.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'da'
+func (da *da) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ t := locales.T(n, v)
+
+ if (n == 1) || (t != 0 && (i == 0 || i == 1)) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'da'
+func (da *da) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'da'
+func (da *da) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := da.CardinalPluralRule(num1, v1)
+ end := da.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (da *da) MonthAbbreviated(month time.Month) string {
+ return da.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (da *da) MonthsAbbreviated() []string {
+ return da.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (da *da) MonthNarrow(month time.Month) string {
+ return da.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (da *da) MonthsNarrow() []string {
+ return da.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (da *da) MonthWide(month time.Month) string {
+ return da.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (da *da) MonthsWide() []string {
+ return da.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (da *da) WeekdayAbbreviated(weekday time.Weekday) string {
+ return da.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (da *da) WeekdaysAbbreviated() []string {
+ return da.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (da *da) WeekdayNarrow(weekday time.Weekday) string {
+ return da.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (da *da) WeekdaysNarrow() []string {
+ return da.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (da *da) WeekdayShort(weekday time.Weekday) string {
+ return da.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (da *da) WeekdaysShort() []string {
+ return da.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (da *da) WeekdayWide(weekday time.Weekday) string {
+ return da.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (da *da) WeekdaysWide() []string {
+ return da.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (da *da) Decimal() string {
+ return da.decimal
+}
+
+// Group returns the group of number
+func (da *da) Group() string {
+ return da.group
+}
+
+// Group returns the minus sign of number
+func (da *da) Minus() string {
+ return da.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'da' and handles both Whole and Real numbers based on 'v'
+func (da *da) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'da' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (da *da) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, da.percentSuffix...)
+
+ b = append(b, da.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'da'
+func (da *da) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, da.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'da'
+// in accounting notation.
+func (da *da) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, da.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, da.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, da.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'da'
+func (da *da) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'da'
+func (da *da) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'da'
+func (da *da) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'da'
+func (da *da) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, da.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65, 0x6e}...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'da'
+func (da *da) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'da'
+func (da *da) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'da'
+func (da *da) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'da'
+func (da *da) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := da.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/da/da_test.go b/vendor/github.com/go-playground/locales/da/da_test.go
new file mode 100644
index 000000000..26437b21a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da/da_test.go
@@ -0,0 +1,1120 @@
+package da
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/da_DK/da_DK.go b/vendor/github.com/go-playground/locales/da_DK/da_DK.go
new file mode 100644
index 000000000..a5705d69a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da_DK/da_DK.go
@@ -0,0 +1,623 @@
+package da_DK
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type da_DK struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'da_DK' locale
+func New() locales.Translator {
+ return &da_DK{
+ locale: "da_DK",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ".",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"},
+ daysAbbreviated: []string{"søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."},
+ daysNarrow: []string{"S", "M", "T", "O", "T", "F", "L"},
+ daysShort: []string{"sø", "ma", "ti", "on", "to", "fr", "lø"},
+ daysWide: []string{"søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"f.Kr.", "e.Kr."},
+ erasNarrow: []string{"fKr", "eKr"},
+ erasWide: []string{"f.Kr.", "e.Kr."},
+ timezones: map[string]string{"ARST": "Argentinsk sommertid", "CHAST": "Chatham-normaltid", "CHADT": "Chatham-sommertid", "HNCU": "Cubansk normaltid", "ACST": "Centralaustralsk normaltid", "ACWST": "Vestlig centralaustralsk normaltid", "MEZ": "Centraleuropæisk normaltid", "WITA": "Centralindonesisk tid", "GMT": "GMT", "WAT": "Vestafrikansk normaltid", "AKST": "Alaska-normaltid", "EST": "Eastern-normaltid", "ACWDT": "Vestlig centralaustralsk sommertid", "HEEG": "Østgrønlandsk sommertid", "WIT": "Østindonesisk tid", "TMT": "Turkmensk normaltid", "SRT": "Surinam-tid", "ChST": "Chamorro-tid", "OEZ": "Østeuropæisk normaltid", "OESZ": "Østeuropæisk sommertid", "UYST": "Uruguayansk sommertid", "ADT": "Atlantic-sommertid", "AEDT": "Østaustralsk sommertid", "IST": "Indien-normaltid", "EAT": "Østafrikansk tid", "ART": "Argentinsk normaltid", "PST": "Pacific-normaltid", "WIB": "Vestindonesisk tid", "MST": "Macao-normaltid", "CLST": "Chilensk sommertid", "HNPMX": "Mexicansk Pacific-normaltid", "SAST": "Sydafrikansk tid", "NZST": "New Zealand-normaltid", "HENOMX": "Nordvestmexicansk sommertid", "AWST": "Vestaustralsk normaltid", "MYT": "Malaysia-tid", "SGT": "Singapore-tid", "TMST": "Turkmensk sommertid", "PDT": "Pacific-sommertid", "GYT": "Guyana-tid", "NZDT": "New Zealand-sommertid", "WEZ": "Vesteuropæisk normaltid", "ECT": "Ecuadoriansk tid", "HKT": "Hongkong-normaltid", "CAT": "Centralafrikansk tid", "HEPMX": "Mexicansk Pacific-sommertid", "BT": "Bhutan-tid", "JST": "Japansk normaltid", "HNOG": "Vestgrønlandsk normaltid", "LHDT": "Lord Howe-sommertid", "HNPM": "Saint Pierre- og Miquelon-normaltid", "HAT": "Newfoundlandsk sommertid", "HNNOMX": "Nordvestmexicansk normaltid", "CLT": "Chilensk normaltid", "COT": "Colombiansk normaltid", "MESZ": "Centraleuropæisk sommertid", "HNT": "Newfoundlandsk normaltid", "HADT": "Hawaii-Aleutian-sommertid", "AWDT": "Vestaustralsk sommertid", "HEOG": "Vestgrønlandsk sommertid", "WARST": "Vestargentinsk sommertid", "HAST": "Hawaii-Aleutian-normaltid", "AST": "Atlantic-normaltid", "WAST": "Vestafrikansk sommertid", "HECU": "Cubansk sommertid", "CDT": "Central-sommertid", "EDT": "Eastern-sommertid", "ACDT": "Centralaustralsk sommertid", "HNEG": "Østgrønlandsk normaltid", "HKST": "Hongkong-sommertid", "MDT": "Macao-sommertid", "VET": "Venezuelansk tid", "HEPM": "Saint Pierre- og Miquelon-sommertid", "UYT": "Uruguayansk normaltid", "AEST": "Østaustralsk normaltid", "WESZ": "Vesteuropæisk sommertid", "BOT": "Boliviansk tid", "∅∅∅": "Azorerne-sommertid", "WART": "Vestargentinsk normaltid", "JDT": "Japansk sommertid", "AKDT": "Alaska-sommertid", "CST": "Central-normaltid", "GFT": "Fransk Guyana-tid", "LHST": "Lord Howe-normaltid", "COST": "Colombiansk sommertid"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (da *da_DK) Locale() string {
+ return da.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'da_DK'
+func (da *da_DK) PluralsCardinal() []locales.PluralRule {
+ return da.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'da_DK'
+func (da *da_DK) PluralsOrdinal() []locales.PluralRule {
+ return da.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'da_DK'
+func (da *da_DK) PluralsRange() []locales.PluralRule {
+ return da.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'da_DK'
+func (da *da_DK) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ t := locales.T(n, v)
+
+ if (n == 1) || (t != 0 && (i == 0 || i == 1)) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'da_DK'
+func (da *da_DK) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'da_DK'
+func (da *da_DK) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := da.CardinalPluralRule(num1, v1)
+ end := da.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (da *da_DK) MonthAbbreviated(month time.Month) string {
+ return da.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (da *da_DK) MonthsAbbreviated() []string {
+ return da.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (da *da_DK) MonthNarrow(month time.Month) string {
+ return da.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (da *da_DK) MonthsNarrow() []string {
+ return da.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (da *da_DK) MonthWide(month time.Month) string {
+ return da.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (da *da_DK) MonthsWide() []string {
+ return da.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (da *da_DK) WeekdayAbbreviated(weekday time.Weekday) string {
+ return da.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (da *da_DK) WeekdaysAbbreviated() []string {
+ return da.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (da *da_DK) WeekdayNarrow(weekday time.Weekday) string {
+ return da.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (da *da_DK) WeekdaysNarrow() []string {
+ return da.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (da *da_DK) WeekdayShort(weekday time.Weekday) string {
+ return da.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (da *da_DK) WeekdaysShort() []string {
+ return da.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (da *da_DK) WeekdayWide(weekday time.Weekday) string {
+ return da.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (da *da_DK) WeekdaysWide() []string {
+ return da.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (da *da_DK) Decimal() string {
+ return da.decimal
+}
+
+// Group returns the group of number
+func (da *da_DK) Group() string {
+ return da.group
+}
+
+// Group returns the minus sign of number
+func (da *da_DK) Minus() string {
+ return da.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'da_DK' and handles both Whole and Real numbers based on 'v'
+func (da *da_DK) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'da_DK' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (da *da_DK) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, da.percentSuffix...)
+
+ b = append(b, da.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'da_DK'
+func (da *da_DK) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, da.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'da_DK'
+// in accounting notation.
+func (da *da_DK) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, da.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, da.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, da.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'da_DK'
+func (da *da_DK) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'da_DK'
+func (da *da_DK) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'da_DK'
+func (da *da_DK) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'da_DK'
+func (da *da_DK) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, da.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65, 0x6e}...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'da_DK'
+func (da *da_DK) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'da_DK'
+func (da *da_DK) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'da_DK'
+func (da *da_DK) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'da_DK'
+func (da *da_DK) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := da.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/da_DK/da_DK_test.go b/vendor/github.com/go-playground/locales/da_DK/da_DK_test.go
new file mode 100644
index 000000000..71ed28d7c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da_DK/da_DK_test.go
@@ -0,0 +1,1120 @@
+package da_DK
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da_DK"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/da_GL/da_GL.go b/vendor/github.com/go-playground/locales/da_GL/da_GL.go
new file mode 100644
index 000000000..4fbc6aae1
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da_GL/da_GL.go
@@ -0,0 +1,623 @@
+package da_GL
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type da_GL struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'da_GL' locale
+func New() locales.Translator {
+ return &da_GL{
+ locale: "da_GL",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ".",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan.", "feb.", "mar.", "apr.", "maj", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "januar", "februar", "marts", "april", "maj", "juni", "juli", "august", "september", "oktober", "november", "december"},
+ daysAbbreviated: []string{"søn.", "man.", "tir.", "ons.", "tor.", "fre.", "lør."},
+ daysNarrow: []string{"S", "M", "T", "O", "T", "F", "L"},
+ daysShort: []string{"sø", "ma", "ti", "on", "to", "fr", "lø"},
+ daysWide: []string{"søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"},
+ periodsAbbreviated: []string{"AM", "PM"},
+ periodsNarrow: []string{"a", "p"},
+ periodsWide: []string{"AM", "PM"},
+ erasAbbreviated: []string{"f.Kr.", "e.Kr."},
+ erasNarrow: []string{"fKr", "eKr"},
+ erasWide: []string{"f.Kr.", "e.Kr."},
+ timezones: map[string]string{"GFT": "Fransk Guyana-tid", "AST": "Atlantic-normaltid", "WESZ": "Vesteuropæisk sommertid", "ECT": "Ecuadoriansk tid", "LHST": "Lord Howe-normaltid", "WARST": "Vestargentinsk sommertid", "CLT": "Chilensk normaltid", "HEPMX": "Mexicansk Pacific-sommertid", "AEDT": "Østaustralsk sommertid", "IST": "Indien-normaltid", "VET": "Venezuelansk tid", "HNCU": "Cubansk normaltid", "BT": "Bhutan-tid", "OESZ": "Østeuropæisk sommertid", "HEPM": "Saint Pierre- og Miquelon-sommertid", "ACWDT": "Vestlig centralaustralsk sommertid", "NZST": "New Zealand-normaltid", "HKST": "Hongkong-sommertid", "AWDT": "Vestaustralsk sommertid", "CDT": "Central-sommertid", "AEST": "Østaustralsk normaltid", "ADT": "Atlantic-sommertid", "HEEG": "Østgrønlandsk sommertid", "MEZ": "Centraleuropæisk normaltid", "ART": "Argentinsk normaltid", "COT": "Colombiansk normaltid", "∅∅∅": "Amazonas-sommertid", "SGT": "Singapore-tid", "EST": "Eastern-normaltid", "HENOMX": "Nordvestmexicansk sommertid", "HADT": "Hawaii-Aleutian-sommertid", "MYT": "Malaysia-tid", "JST": "Japansk normaltid", "JDT": "Japansk sommertid", "AKDT": "Alaska-sommertid", "HNT": "Newfoundlandsk normaltid", "SRT": "Surinam-tid", "CHAST": "Chatham-normaltid", "HNPMX": "Mexicansk Pacific-normaltid", "PST": "Pacific-normaltid", "HNEG": "Østgrønlandsk normaltid", "HNOG": "Vestgrønlandsk normaltid", "HKT": "Hongkong-normaltid", "CAT": "Centralafrikansk tid", "ARST": "Argentinsk sommertid", "UYST": "Uruguayansk sommertid", "AKST": "Alaska-normaltid", "LHDT": "Lord Howe-sommertid", "HAT": "Newfoundlandsk sommertid", "HNNOMX": "Nordvestmexicansk normaltid", "COST": "Colombiansk sommertid", "GYT": "Guyana-tid", "BOT": "Boliviansk tid", "PDT": "Pacific-sommertid", "HEOG": "Vestgrønlandsk sommertid", "WITA": "Centralindonesisk tid", "MDT": "Macao-sommertid", "EAT": "Østafrikansk tid", "OEZ": "Østeuropæisk normaltid", "HAST": "Hawaii-Aleutian-normaltid", "HECU": "Cubansk sommertid", "CHADT": "Chatham-sommertid", "CST": "Central-normaltid", "WAT": "Vestafrikansk normaltid", "MST": "Macao-normaltid", "CLST": "Chilensk sommertid", "TMT": "Turkmensk normaltid", "WART": "Vestargentinsk normaltid", "HNPM": "Saint Pierre- og Miquelon-normaltid", "NZDT": "New Zealand-sommertid", "ACDT": "Centralaustralsk sommertid", "EDT": "Eastern-sommertid", "UYT": "Uruguayansk normaltid", "GMT": "GMT", "AWST": "Vestaustralsk normaltid", "ACWST": "Vestlig centralaustralsk normaltid", "WIT": "Østindonesisk tid", "ChST": "Chamorro-tid", "ACST": "Centralaustralsk normaltid", "WIB": "Vestindonesisk tid", "SAST": "Sydafrikansk tid", "MESZ": "Centraleuropæisk sommertid", "TMST": "Turkmensk sommertid", "WAST": "Vestafrikansk sommertid", "WEZ": "Vesteuropæisk normaltid"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (da *da_GL) Locale() string {
+ return da.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'da_GL'
+func (da *da_GL) PluralsCardinal() []locales.PluralRule {
+ return da.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'da_GL'
+func (da *da_GL) PluralsOrdinal() []locales.PluralRule {
+ return da.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'da_GL'
+func (da *da_GL) PluralsRange() []locales.PluralRule {
+ return da.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'da_GL'
+func (da *da_GL) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ t := locales.T(n, v)
+
+ if (n == 1) || (t != 0 && (i == 0 || i == 1)) {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'da_GL'
+func (da *da_GL) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'da_GL'
+func (da *da_GL) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := da.CardinalPluralRule(num1, v1)
+ end := da.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (da *da_GL) MonthAbbreviated(month time.Month) string {
+ return da.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (da *da_GL) MonthsAbbreviated() []string {
+ return da.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (da *da_GL) MonthNarrow(month time.Month) string {
+ return da.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (da *da_GL) MonthsNarrow() []string {
+ return da.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (da *da_GL) MonthWide(month time.Month) string {
+ return da.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (da *da_GL) MonthsWide() []string {
+ return da.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (da *da_GL) WeekdayAbbreviated(weekday time.Weekday) string {
+ return da.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (da *da_GL) WeekdaysAbbreviated() []string {
+ return da.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (da *da_GL) WeekdayNarrow(weekday time.Weekday) string {
+ return da.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (da *da_GL) WeekdaysNarrow() []string {
+ return da.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (da *da_GL) WeekdayShort(weekday time.Weekday) string {
+ return da.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (da *da_GL) WeekdaysShort() []string {
+ return da.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (da *da_GL) WeekdayWide(weekday time.Weekday) string {
+ return da.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (da *da_GL) WeekdaysWide() []string {
+ return da.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (da *da_GL) Decimal() string {
+ return da.decimal
+}
+
+// Group returns the group of number
+func (da *da_GL) Group() string {
+ return da.group
+}
+
+// Group returns the minus sign of number
+func (da *da_GL) Minus() string {
+ return da.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'da_GL' and handles both Whole and Real numbers based on 'v'
+func (da *da_GL) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'da_GL' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (da *da_GL) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, da.percentSuffix...)
+
+ b = append(b, da.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'da_GL'
+func (da *da_GL) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, da.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, da.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'da_GL'
+// in accounting notation.
+func (da *da_GL) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := da.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, da.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, da.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, da.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, da.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, da.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, da.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'da_GL'
+func (da *da_GL) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'da_GL'
+func (da *da_GL) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'da_GL'
+func (da *da_GL) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'da_GL'
+func (da *da_GL) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, da.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20, 0x64, 0x65, 0x6e}...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, da.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'da_GL'
+func (da *da_GL) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'da_GL'
+func (da *da_GL) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'da_GL'
+func (da *da_GL) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'da_GL'
+func (da *da_GL) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := da.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/da_GL/da_GL_test.go b/vendor/github.com/go-playground/locales/da_GL/da_GL_test.go
new file mode 100644
index 000000000..b5d1ee8ad
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/da_GL/da_GL_test.go
@@ -0,0 +1,1120 @@
+package da_GL
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "da_GL"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dav/dav.go b/vendor/github.com/go-playground/locales/dav/dav.go
new file mode 100644
index 000000000..45f76f387
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dav/dav.go
@@ -0,0 +1,533 @@
+package dav
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dav struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dav' locale
+func New() locales.Translator {
+ return &dav{
+ locale: "dav",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "Ksh", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Imb", "Kaw", "Kad", "Kan", "Kas", "Kar", "Mfu", "Wun", "Ike", "Iku", "Imw", "Iwi"},
+ monthsNarrow: []string{"", "I", "K", "K", "K", "K", "K", "M", "W", "I", "I", "I", "I"},
+ monthsWide: []string{"", "Mori ghwa imbiri", "Mori ghwa kawi", "Mori ghwa kadadu", "Mori ghwa kana", "Mori ghwa kasanu", "Mori ghwa karandadu", "Mori ghwa mfungade", "Mori ghwa wunyanya", "Mori ghwa ikenda", "Mori ghwa ikumi", "Mori ghwa ikumi na imweri", "Mori ghwa ikumi na iwi"},
+ daysAbbreviated: []string{"Jum", "Jim", "Kaw", "Kad", "Kan", "Kas", "Ngu"},
+ daysNarrow: []string{"J", "J", "K", "K", "K", "K", "N"},
+ daysWide: []string{"Ituku ja jumwa", "Kuramuka jimweri", "Kuramuka kawi", "Kuramuka kadadu", "Kuramuka kana", "Kuramuka kasanu", "Kifula nguwo"},
+ periodsAbbreviated: []string{"Luma lwa K", "luma lwa p"},
+ periodsWide: []string{"Luma lwa K", "luma lwa p"},
+ erasAbbreviated: []string{"KK", "BK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
+ timezones: map[string]string{"HNCU": "HNCU", "SGT": "SGT", "HNEG": "HNEG", "ART": "ART", "WIT": "WIT", "UYST": "UYST", "AEST": "AEST", "HNT": "HNT", "WITA": "WITA", "EST": "EST", "OESZ": "OESZ", "EDT": "EDT", "CLT": "CLT", "CHAST": "CHAST", "PST": "PST", "SAST": "SAST", "WAT": "WAT", "BOT": "BOT", "GYT": "GYT", "HNPMX": "HNPMX", "NZST": "NZST", "GFT": "GFT", "ACDT": "ACDT", "HEOG": "HEOG", "IST": "IST", "AEDT": "AEDT", "MST": "MST", "WIB": "WIB", "TMT": "TMT", "HADT": "HADT", "AWST": "AWST", "LHDT": "LHDT", "HEPM": "HEPM", "CLST": "CLST", "OEZ": "OEZ", "WARST": "WARST", "HNPM": "HNPM", "EAT": "EAT", "HAT": "HAT", "ACWST": "ACWST", "MEZ": "MEZ", "HKST": "HKST", "HENOMX": "HENOMX", "ChST": "ChST", "CST": "CST", "WAST": "WAST", "LHST": "LHST", "HNNOMX": "HNNOMX", "VET": "VET", "CHADT": "CHADT", "WESZ": "WESZ", "AKST": "AKST", "ECT": "ECT", "WEZ": "WEZ", "WART": "WART", "CAT": "CAT", "TMST": "TMST", "HAST": "HAST", "COT": "COT", "MDT": "MDT", "NZDT": "NZDT", "MESZ": "MESZ", "BT": "BT", "HNOG": "HNOG", "HEPMX": "HEPMX", "PDT": "PDT", "AWDT": "AWDT", "MYT": "MYT", "HECU": "HECU", "CDT": "CDT", "JST": "JST", "HKT": "HKT", "SRT": "SRT", "COST": "COST", "GMT": "GMT", "AST": "AST", "ADT": "ADT", "∅∅∅": "∅∅∅", "UYT": "UYT", "ACWDT": "ACWDT", "HEEG": "HEEG", "ARST": "ARST", "JDT": "JDT", "AKDT": "AKDT", "ACST": "ACST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dav *dav) Locale() string {
+ return dav.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dav'
+func (dav *dav) PluralsCardinal() []locales.PluralRule {
+ return dav.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dav'
+func (dav *dav) PluralsOrdinal() []locales.PluralRule {
+ return dav.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dav'
+func (dav *dav) PluralsRange() []locales.PluralRule {
+ return dav.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dav'
+func (dav *dav) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dav'
+func (dav *dav) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dav'
+func (dav *dav) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dav *dav) MonthAbbreviated(month time.Month) string {
+ return dav.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dav *dav) MonthsAbbreviated() []string {
+ return dav.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dav *dav) MonthNarrow(month time.Month) string {
+ return dav.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dav *dav) MonthsNarrow() []string {
+ return dav.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dav *dav) MonthWide(month time.Month) string {
+ return dav.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dav *dav) MonthsWide() []string {
+ return dav.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dav *dav) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dav.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dav *dav) WeekdaysAbbreviated() []string {
+ return dav.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dav *dav) WeekdayNarrow(weekday time.Weekday) string {
+ return dav.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dav *dav) WeekdaysNarrow() []string {
+ return dav.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dav *dav) WeekdayShort(weekday time.Weekday) string {
+ return dav.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dav *dav) WeekdaysShort() []string {
+ return dav.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dav *dav) WeekdayWide(weekday time.Weekday) string {
+ return dav.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dav *dav) WeekdaysWide() []string {
+ return dav.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dav *dav) Decimal() string {
+ return dav.decimal
+}
+
+// Group returns the group of number
+func (dav *dav) Group() string {
+ return dav.group
+}
+
+// Group returns the minus sign of number
+func (dav *dav) Minus() string {
+ return dav.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dav' and handles both Whole and Real numbers based on 'v'
+func (dav *dav) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dav' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dav *dav) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dav'
+func (dav *dav) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dav.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dav.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dav.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, dav.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dav.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dav'
+// in accounting notation.
+func (dav *dav) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dav.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dav.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dav.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, dav.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dav.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dav.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dav'
+func (dav *dav) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dav'
+func (dav *dav) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dav'
+func (dav *dav) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dav'
+func (dav *dav) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dav.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dav'
+func (dav *dav) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dav'
+func (dav *dav) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dav'
+func (dav *dav) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dav'
+func (dav *dav) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dav.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dav/dav_test.go b/vendor/github.com/go-playground/locales/dav/dav_test.go
new file mode 100644
index 000000000..ad597b3f0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dav/dav_test.go
@@ -0,0 +1,1120 @@
+package dav
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dav"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dav_KE/dav_KE.go b/vendor/github.com/go-playground/locales/dav_KE/dav_KE.go
new file mode 100644
index 000000000..eebb748ca
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dav_KE/dav_KE.go
@@ -0,0 +1,533 @@
+package dav_KE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dav_KE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dav_KE' locale
+func New() locales.Translator {
+ return &dav_KE{
+ locale: "dav_KE",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Imb", "Kaw", "Kad", "Kan", "Kas", "Kar", "Mfu", "Wun", "Ike", "Iku", "Imw", "Iwi"},
+ monthsNarrow: []string{"", "I", "K", "K", "K", "K", "K", "M", "W", "I", "I", "I", "I"},
+ monthsWide: []string{"", "Mori ghwa imbiri", "Mori ghwa kawi", "Mori ghwa kadadu", "Mori ghwa kana", "Mori ghwa kasanu", "Mori ghwa karandadu", "Mori ghwa mfungade", "Mori ghwa wunyanya", "Mori ghwa ikenda", "Mori ghwa ikumi", "Mori ghwa ikumi na imweri", "Mori ghwa ikumi na iwi"},
+ daysAbbreviated: []string{"Jum", "Jim", "Kaw", "Kad", "Kan", "Kas", "Ngu"},
+ daysNarrow: []string{"J", "J", "K", "K", "K", "K", "N"},
+ daysWide: []string{"Ituku ja jumwa", "Kuramuka jimweri", "Kuramuka kawi", "Kuramuka kadadu", "Kuramuka kana", "Kuramuka kasanu", "Kifula nguwo"},
+ periodsAbbreviated: []string{"Luma lwa K", "luma lwa p"},
+ periodsWide: []string{"Luma lwa K", "luma lwa p"},
+ erasAbbreviated: []string{"KK", "BK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Kabla ya Kristo", "Baada ya Kristo"},
+ timezones: map[string]string{"HEPMX": "HEPMX", "MDT": "MDT", "BT": "BT", "AKDT": "AKDT", "EAT": "EAT", "HADT": "HADT", "UYST": "UYST", "HNPMX": "HNPMX", "HNEG": "HNEG", "HNOG": "HNOG", "HKST": "HKST", "CLT": "CLT", "OESZ": "OESZ", "CHADT": "CHADT", "AEST": "AEST", "BOT": "BOT", "HEOG": "HEOG", "EDT": "EDT", "MEZ": "MEZ", "WIT": "WIT", "PDT": "PDT", "MST": "MST", "ADT": "ADT", "WITA": "WITA", "HENOMX": "HENOMX", "ART": "ART", "GMT": "GMT", "AST": "AST", "WARST": "WARST", "AWDT": "AWDT", "SAST": "SAST", "MESZ": "MESZ", "WART": "WART", "WAST": "WAST", "HKT": "HKT", "IST": "IST", "GYT": "GYT", "ChST": "ChST", "JST": "JST", "ACDT": "ACDT", "WAT": "WAT", "WEZ": "WEZ", "JDT": "JDT", "SGT": "SGT", "HAST": "HAST", "OEZ": "OEZ", "PST": "PST", "AEDT": "AEDT", "LHST": "LHST", "ACWST": "ACWST", "HEEG": "HEEG", "COST": "COST", "HECU": "HECU", "CHAST": "CHAST", "GFT": "GFT", "ACWDT": "ACWDT", "HNPM": "HNPM", "TMT": "TMT", "WIB": "WIB", "NZST": "NZST", "NZDT": "NZDT", "HNT": "HNT", "HNCU": "HNCU", "WESZ": "WESZ", "ECT": "ECT", "VET": "VET", "COT": "COT", "SRT": "SRT", "HEPM": "HEPM", "HAT": "HAT", "CLST": "CLST", "MYT": "MYT", "ACST": "ACST", "EST": "EST", "CDT": "CDT", "LHDT": "LHDT", "HNNOMX": "HNNOMX", "CAT": "CAT", "ARST": "ARST", "∅∅∅": "∅∅∅", "AWST": "AWST", "TMST": "TMST", "UYT": "UYT", "CST": "CST", "AKST": "AKST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dav *dav_KE) Locale() string {
+ return dav.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dav_KE'
+func (dav *dav_KE) PluralsCardinal() []locales.PluralRule {
+ return dav.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dav_KE'
+func (dav *dav_KE) PluralsOrdinal() []locales.PluralRule {
+ return dav.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dav_KE'
+func (dav *dav_KE) PluralsRange() []locales.PluralRule {
+ return dav.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dav_KE'
+func (dav *dav_KE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dav_KE'
+func (dav *dav_KE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dav_KE'
+func (dav *dav_KE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dav *dav_KE) MonthAbbreviated(month time.Month) string {
+ return dav.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dav *dav_KE) MonthsAbbreviated() []string {
+ return dav.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dav *dav_KE) MonthNarrow(month time.Month) string {
+ return dav.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dav *dav_KE) MonthsNarrow() []string {
+ return dav.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dav *dav_KE) MonthWide(month time.Month) string {
+ return dav.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dav *dav_KE) MonthsWide() []string {
+ return dav.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dav *dav_KE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dav.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dav *dav_KE) WeekdaysAbbreviated() []string {
+ return dav.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dav *dav_KE) WeekdayNarrow(weekday time.Weekday) string {
+ return dav.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dav *dav_KE) WeekdaysNarrow() []string {
+ return dav.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dav *dav_KE) WeekdayShort(weekday time.Weekday) string {
+ return dav.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dav *dav_KE) WeekdaysShort() []string {
+ return dav.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dav *dav_KE) WeekdayWide(weekday time.Weekday) string {
+ return dav.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dav *dav_KE) WeekdaysWide() []string {
+ return dav.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dav *dav_KE) Decimal() string {
+ return dav.decimal
+}
+
+// Group returns the group of number
+func (dav *dav_KE) Group() string {
+ return dav.group
+}
+
+// Group returns the minus sign of number
+func (dav *dav_KE) Minus() string {
+ return dav.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dav_KE' and handles both Whole and Real numbers based on 'v'
+func (dav *dav_KE) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dav_KE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dav *dav_KE) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dav_KE'
+func (dav *dav_KE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dav.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dav.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dav.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, dav.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dav.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dav_KE'
+// in accounting notation.
+func (dav *dav_KE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dav.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dav.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dav.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, dav.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dav.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dav.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dav.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dav.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dav_KE'
+func (dav *dav_KE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dav.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dav.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dav_KE/dav_KE_test.go b/vendor/github.com/go-playground/locales/dav_KE/dav_KE_test.go
new file mode 100644
index 000000000..6df360717
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dav_KE/dav_KE_test.go
@@ -0,0 +1,1120 @@
+package dav_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dav_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de/de.go b/vendor/github.com/go-playground/locales/de/de.go
new file mode 100644
index 000000000..c87629c26
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de/de.go
@@ -0,0 +1,629 @@
+package de
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de' locale
+func New() locales.Translator {
+ return &de{
+ locale: "de",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "öS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGK", "BGN", "BGJ", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"HEOG": "Westgrönland-Sommerzeit", "CLT": "Chilenische Normalzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "MYT": "Malaysische Zeit", "MEZ": "Mitteleuropäische Normalzeit", "LHST": "Lord-Howe-Normalzeit", "SRT": "Suriname-Zeit", "ARST": "Argentinische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "SAST": "Südafrikanische Zeit", "ECT": "Ecuadorianische Zeit", "ACST": "Zentralaustralische Normalzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "CLST": "Chilenische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "BOT": "Bolivianische Zeit", "WITA": "Zentralindonesische Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "AKDT": "Alaska-Sommerzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "HECU": "Kubanische Sommerzeit", "UYT": "Uruguyanische Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "HKT": "Hongkong-Normalzeit", "WARST": "Westargentinische Sommerzeit", "VET": "Venezuela-Zeit", "TMT": "Turkmenistan-Normalzeit", "HNCU": "Kubanische Normalzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "ADT": "Atlantik-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "CAT": "Zentralafrikanische Zeit", "HAST": "Hawaii-Aleuten-Normalzeit", "CHAST": "Chatham-Normalzeit", "WAST": "Westafrikanische Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "WART": "Westargentinische Normalzeit", "HNT": "Neufundland-Normalzeit", "WIB": "Westindonesische Zeit", "NZST": "Neuseeland-Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "WIT": "Ostindonesische Zeit", "MDT": "Rocky-Mountain-Sommerzeit", "AKST": "Alaska-Normalzeit", "SGT": "Singapur-Zeit", "COST": "Kolumbianische Sommerzeit", "CHADT": "Chatham-Sommerzeit", "GYT": "Guyana-Zeit", "AWDT": "Westaustralische Sommerzeit", "∅∅∅": "Acre-Sommerzeit", "HNOG": "Westgrönland-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "IST": "Indische Zeit", "OEZ": "Osteuropäische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "AWST": "Westaustralische Normalzeit", "WAT": "Westafrikanische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "HEEG": "Ostgrönland-Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "EAT": "Ostafrikanische Zeit", "BT": "Bhutan-Zeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "COT": "Kolumbianische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "ChST": "Chamorro-Zeit", "AEST": "Ostaustralische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "MST": "Rocky Mountain-Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "AST": "Atlantik-Normalzeit", "JST": "Japanische Normalzeit", "JDT": "Japanische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "ART": "Argentinische Normalzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de'
+func (de *de) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de'
+func (de *de) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de'
+func (de *de) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de'
+func (de *de) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de'
+func (de *de) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de'
+func (de *de) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de' and handles both Whole and Real numbers based on 'v'
+func (de *de) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de'
+func (de *de) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, de.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de'
+// in accounting notation.
+func (de *de) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, de.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, de.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, de.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de'
+func (de *de) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de'
+func (de *de) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de'
+func (de *de) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de'
+func (de *de) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de'
+func (de *de) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de'
+func (de *de) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de'
+func (de *de) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de'
+func (de *de) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de/de_test.go b/vendor/github.com/go-playground/locales/de/de_test.go
new file mode 100644
index 000000000..825cb300e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de/de_test.go
@@ -0,0 +1,1120 @@
+package de
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_AT/de_AT.go b/vendor/github.com/go-playground/locales/de_AT/de_AT.go
new file mode 100644
index 000000000..fcf2d37ae
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_AT/de_AT.go
@@ -0,0 +1,648 @@
+package de_AT
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_AT struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_AT' locale
+func New() locales.Translator {
+ return &de_AT{
+ locale: "de_AT",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: " ",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "Jän.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"AST": "Atlantik-Normalzeit", "AKST": "Alaska-Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HAT": "Neufundland-Sommerzeit", "WIT": "Ostindonesische Zeit", "TMT": "Turkmenistan-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "GFT": "Französisch-Guayana-Zeit", "HNCU": "Kubanische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "WIB": "Westindonesische Zeit", "ChST": "Chamorro-Zeit", "CLT": "Chilenische Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "BOT": "Bolivianische Zeit", "TMST": "Turkmenistan-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "AWST": "Westaustralische Normalzeit", "MYT": "Malaysische Zeit", "BT": "Bhutan-Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "HECU": "Kubanische Sommerzeit", "SAST": "Südafrikanische Zeit", "NZDT": "Neuseeland-Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "HEEG": "Ostgrönland-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "CHADT": "Chatham-Sommerzeit", "JDT": "Japanische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "HNEG": "Ostgrönland-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "CHAST": "Chatham-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "CLST": "Chilenische Sommerzeit", "ADT": "Atlantik-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "SGT": "Singapur-Zeit", "LHST": "Lord-Howe-Normalzeit", "WITA": "Zentralindonesische Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "MST": "Rocky Mountain-Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "JST": "Japanische Normalzeit", "AKDT": "Alaska-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "VET": "Venezuela-Zeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "EAT": "Ostafrikanische Zeit", "OEZ": "Osteuropäische Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HKT": "Hongkong-Normalzeit", "IST": "Indische Zeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "HNT": "Neufundland-Normalzeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "SRT": "Suriname-Zeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "NZST": "Neuseeland-Normalzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "COST": "Kolumbianische Sommerzeit", "∅∅∅": "Amazonas-Sommerzeit", "GYT": "Guyana-Zeit", "WEZ": "Westeuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "CAT": "Zentralafrikanische Zeit", "COT": "Kolumbianische Normalzeit", "AEST": "Ostaustralische Normalzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_AT) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_AT'
+func (de *de_AT) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_AT'
+func (de *de_AT) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_AT'
+func (de *de_AT) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_AT'
+func (de *de_AT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_AT'
+func (de *de_AT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_AT'
+func (de *de_AT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_AT) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_AT) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_AT) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_AT) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_AT) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_AT) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_AT) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_AT) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_AT) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_AT) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_AT) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_AT) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_AT) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_AT) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_AT) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_AT) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_AT) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
+func (de *de_AT) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_AT) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
+func (de *de_AT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
+// in accounting notation.
+func (de *de_AT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyNegativePrefix[j])
+ }
+
+ b = append(b, de.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_AT'
+func (de *de_AT) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_AT'
+func (de *de_AT) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_AT'
+func (de *de_AT) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_AT'
+func (de *de_AT) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_AT'
+func (de *de_AT) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_AT'
+func (de *de_AT) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_AT'
+func (de *de_AT) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_AT'
+func (de *de_AT) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_AT/de_AT_test.go b/vendor/github.com/go-playground/locales/de_AT/de_AT_test.go
new file mode 100644
index 000000000..fccc4a7df
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_AT/de_AT_test.go
@@ -0,0 +1,1120 @@
+package de_AT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_AT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_BE/de_BE.go b/vendor/github.com/go-playground/locales/de_BE/de_BE.go
new file mode 100644
index 000000000..f7bdee33b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_BE/de_BE.go
@@ -0,0 +1,629 @@
+package de_BE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_BE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_BE' locale
+func New() locales.Translator {
+ return &de_BE{
+ locale: "de_BE",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"CLT": "Chilenische Normalzeit", "CAT": "Zentralafrikanische Zeit", "HNCU": "Kubanische Normalzeit", "ECT": "Ecuadorianische Zeit", "WITA": "Zentralindonesische Zeit", "AEST": "Ostaustralische Normalzeit", "AST": "Atlantik-Normalzeit", "ADT": "Atlantik-Sommerzeit", "GYT": "Guyana-Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "IST": "Indische Zeit", "COST": "Kolumbianische Sommerzeit", "HECU": "Kubanische Sommerzeit", "AWST": "Westaustralische Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "AKST": "Alaska-Normalzeit", "HNT": "Neufundland-Normalzeit", "WAT": "Westafrikanische Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "WARST": "Westargentinische Sommerzeit", "∅∅∅": "Amazonas-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "CHAST": "Chatham-Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "WIT": "Ostindonesische Zeit", "ChST": "Chamorro-Zeit", "CHADT": "Chatham-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "JST": "Japanische Normalzeit", "MDT": "Macau-Sommerzeit", "TMT": "Turkmenistan-Normalzeit", "ART": "Argentinische Normalzeit", "BOT": "Bolivianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "NZST": "Neuseeland-Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HKST": "Hongkong-Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "MYT": "Malaysische Zeit", "JDT": "Japanische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "VET": "Venezuela-Zeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "COT": "Kolumbianische Normalzeit", "UYST": "Uruguayanische Sommerzeit", "SAST": "Südafrikanische Zeit", "BT": "Bhutan-Zeit", "HEEG": "Ostgrönland-Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "WART": "Westargentinische Normalzeit", "SRT": "Suriname-Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "WIB": "Westindonesische Zeit", "AKDT": "Alaska-Sommerzeit", "MST": "Macau-Normalzeit", "CLST": "Chilenische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "OEZ": "Osteuropäische Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "EAT": "Ostafrikanische Zeit", "TMST": "Turkmenistan-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "HEOG": "Westgrönland-Sommerzeit", "HKT": "Hongkong-Normalzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "ARST": "Argentinische Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "SGT": "Singapur-Zeit", "OESZ": "Osteuropäische Sommerzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_BE) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_BE'
+func (de *de_BE) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_BE'
+func (de *de_BE) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_BE'
+func (de *de_BE) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_BE'
+func (de *de_BE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_BE'
+func (de *de_BE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_BE'
+func (de *de_BE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_BE) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_BE) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_BE) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_BE) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_BE) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_BE) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_BE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_BE) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_BE) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_BE) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_BE) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_BE) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_BE) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_BE) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_BE) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_BE) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_BE) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_BE' and handles both Whole and Real numbers based on 'v'
+func (de *de_BE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_BE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_BE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_BE'
+func (de *de_BE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, de.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_BE'
+// in accounting notation.
+func (de *de_BE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, de.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, de.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, de.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_BE'
+func (de *de_BE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_BE'
+func (de *de_BE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_BE'
+func (de *de_BE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_BE'
+func (de *de_BE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_BE'
+func (de *de_BE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_BE'
+func (de *de_BE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_BE'
+func (de *de_BE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_BE'
+func (de *de_BE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_BE/de_BE_test.go b/vendor/github.com/go-playground/locales/de_BE/de_BE_test.go
new file mode 100644
index 000000000..5d56e161b
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_BE/de_BE_test.go
@@ -0,0 +1,1120 @@
+package de_BE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_BE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_CH/de_CH.go b/vendor/github.com/go-playground/locales/de_CH/de_CH.go
new file mode 100644
index 000000000..bc55e5f70
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_CH/de_CH.go
@@ -0,0 +1,644 @@
+package de_CH
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_CH struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_CH' locale
+func New() locales.Translator {
+ return &de_CH{
+ locale: "de_CH",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: "’",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"WIT": "Ostindonesische Zeit", "UYT": "Uruguyanische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "WIB": "Westindonesische Zeit", "HNEG": "Ostgrönland-Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "WARST": "Westargentinische Sommerzeit", "HECU": "Kubanische Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "MYT": "Malaysische Zeit", "LHST": "Lord-Howe-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "WART": "Westargentinische Normalzeit", "IST": "Indische Zeit", "AWST": "Westaustralische Normalzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "AST": "Atlantik-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "GYT": "Guyana-Zeit", "CST": "Nordamerikanische Inland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "HNT": "Neufundland-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "SAST": "Südafrikanische Zeit", "NZST": "Neuseeland-Normalzeit", "GFT": "Französisch-Guayana-Zeit", "AKST": "Alaska-Normalzeit", "∅∅∅": "Brasília-Sommerzeit", "AWDT": "Westaustralische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "WAT": "Westafrikanische Normalzeit", "SGT": "Singapur-Zeit", "CLST": "Chilenische Sommerzeit", "VET": "Venezuela-Zeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "SRT": "Suriname-Zeit", "EAT": "Ostafrikanische Zeit", "BOT": "Bolivianische Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HKST": "Hongkong-Sommerzeit", "HAT": "Neufundland-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "JDT": "Japanische Sommerzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "CHAST": "Chatham-Normalzeit", "CHADT": "Chatham-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "ADT": "Atlantik-Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "ART": "Argentinische Normalzeit", "BT": "Bhutan-Zeit", "HKT": "Hongkong-Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "WITA": "Zentralindonesische Zeit", "COT": "Kolumbianische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "ECT": "Ecuadorianische Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "ARST": "Argentinische Sommerzeit", "MST": "Rocky Mountain-Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "ChST": "Chamorro-Zeit", "OEZ": "Osteuropäische Normalzeit", "HNCU": "Kubanische Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "ACDT": "Zentralaustralische Sommerzeit", "HEEG": "Ostgrönland-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "GMT": "Mittlere Greenwich-Zeit", "JST": "Japanische Normalzeit", "ACST": "Zentralaustralische Normalzeit", "CLT": "Chilenische Normalzeit", "TMT": "Turkmenistan-Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "AKDT": "Alaska-Sommerzeit", "HEOG": "Westgrönland-Sommerzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_CH) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_CH'
+func (de *de_CH) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_CH'
+func (de *de_CH) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_CH'
+func (de *de_CH) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_CH'
+func (de *de_CH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_CH'
+func (de *de_CH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_CH'
+func (de *de_CH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_CH) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_CH) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_CH) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_CH) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_CH) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_CH) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_CH) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_CH) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_CH) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_CH) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_CH) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_CH) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_CH) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_CH) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_CH) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_CH) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_CH) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_CH' and handles both Whole and Real numbers based on 'v'
+func (de *de_CH) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_CH' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_CH) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_CH'
+func (de *de_CH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_CH'
+// in accounting notation.
+func (de *de_CH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyNegativePrefix[j])
+ }
+
+ b = append(b, de.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_CH'
+func (de *de_CH) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_CH'
+func (de *de_CH) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_CH'
+func (de *de_CH) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_CH'
+func (de *de_CH) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_CH'
+func (de *de_CH) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_CH'
+func (de *de_CH) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_CH'
+func (de *de_CH) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_CH'
+func (de *de_CH) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_CH/de_CH_test.go b/vendor/github.com/go-playground/locales/de_CH/de_CH_test.go
new file mode 100644
index 000000000..b528b5c95
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_CH/de_CH_test.go
@@ -0,0 +1,1120 @@
+package de_CH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_CH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_DE/de_DE.go b/vendor/github.com/go-playground/locales/de_DE/de_DE.go
new file mode 100644
index 000000000..7976a8444
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_DE/de_DE.go
@@ -0,0 +1,629 @@
+package de_DE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_DE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_DE' locale
+func New() locales.Translator {
+ return &de_DE{
+ locale: "de_DE",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"ACST": "Zentralaustralische Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "WART": "Westargentinische Normalzeit", "HAT": "Neufundland-Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "WAT": "Westafrikanische Normalzeit", "BOT": "Bolivianische Zeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "CHAST": "Chatham-Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "WIT": "Ostindonesische Zeit", "TMST": "Turkmenistan-Sommerzeit", "HEOG": "Westgrönland-Sommerzeit", "WITA": "Zentralindonesische Zeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "MDT": "Macau-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "HNCU": "Kubanische Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "SGT": "Singapur-Zeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "OEZ": "Osteuropäische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "∅∅∅": "Acre-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ChST": "Chamorro-Zeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AKDT": "Alaska-Sommerzeit", "EAT": "Ostafrikanische Zeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "JST": "Japanische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "AST": "Atlantik-Normalzeit", "JDT": "Japanische Sommerzeit", "ARST": "Argentinische Sommerzeit", "VET": "Venezuela-Zeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "SRT": "Suriname-Zeit", "CLT": "Chilenische Normalzeit", "ART": "Argentinische Normalzeit", "HECU": "Kubanische Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "GFT": "Französisch-Guayana-Zeit", "BT": "Bhutan-Zeit", "HAST": "Hawaii-Aleuten-Normalzeit", "CHADT": "Chatham-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "TMT": "Turkmenistan-Normalzeit", "ADT": "Atlantik-Sommerzeit", "IST": "Indische Zeit", "MST": "Macau-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "NZDT": "Neuseeland-Sommerzeit", "GYT": "Guyana-Zeit", "HNOG": "Westgrönland-Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "SAST": "Südafrikanische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "MYT": "Malaysische Zeit", "AKST": "Alaska-Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "COT": "Kolumbianische Normalzeit", "AWST": "Westaustralische Normalzeit", "WEZ": "Westeuropäische Normalzeit", "WIB": "Westindonesische Zeit", "AWDT": "Westaustralische Sommerzeit", "CLST": "Chilenische Sommerzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HEEG": "Ostgrönland-Sommerzeit", "HNT": "Neufundland-Normalzeit", "CAT": "Zentralafrikanische Zeit", "AEST": "Ostaustralische Normalzeit", "HKT": "Hongkong-Normalzeit", "WARST": "Westargentinische Sommerzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_DE) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_DE'
+func (de *de_DE) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_DE'
+func (de *de_DE) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_DE'
+func (de *de_DE) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_DE'
+func (de *de_DE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_DE'
+func (de *de_DE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_DE'
+func (de *de_DE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_DE) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_DE) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_DE) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_DE) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_DE) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_DE) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_DE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_DE) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_DE) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_DE) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_DE) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_DE) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_DE) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_DE) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_DE) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_DE) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_DE) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_DE' and handles both Whole and Real numbers based on 'v'
+func (de *de_DE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_DE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_DE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_DE'
+func (de *de_DE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, de.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_DE'
+// in accounting notation.
+func (de *de_DE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, de.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, de.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, de.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_DE'
+func (de *de_DE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_DE'
+func (de *de_DE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_DE'
+func (de *de_DE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_DE'
+func (de *de_DE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_DE'
+func (de *de_DE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_DE'
+func (de *de_DE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_DE'
+func (de *de_DE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_DE'
+func (de *de_DE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_DE/de_DE_test.go b/vendor/github.com/go-playground/locales/de_DE/de_DE_test.go
new file mode 100644
index 000000000..9425f3787
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_DE/de_DE_test.go
@@ -0,0 +1,1120 @@
+package de_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_IT/de_IT.go b/vendor/github.com/go-playground/locales/de_IT/de_IT.go
new file mode 100644
index 000000000..55eecc324
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_IT/de_IT.go
@@ -0,0 +1,629 @@
+package de_IT
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_IT struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_IT' locale
+func New() locales.Translator {
+ return &de_IT{
+ locale: "de_IT",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jän.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"WIT": "Ostindonesische Zeit", "GMT": "Mittlere Greenwich-Zeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "MYT": "Malaysische Zeit", "ChST": "Chamorro-Zeit", "MESZ": "Mitteleuropäische Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "∅∅∅": "Azoren-Sommerzeit", "VET": "Venezuela-Zeit", "CLST": "Chilenische Sommerzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "SAST": "Südafrikanische Zeit", "AKST": "Alaska-Normalzeit", "SRT": "Suriname-Zeit", "OEZ": "Osteuropäische Normalzeit", "AWST": "Westaustralische Normalzeit", "IST": "Indische Zeit", "AKDT": "Alaska-Sommerzeit", "HEEG": "Ostgrönland-Sommerzeit", "WITA": "Zentralindonesische Zeit", "BOT": "Bolivianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "ECT": "Ecuadorianische Zeit", "BT": "Bhutan-Zeit", "HNOG": "Westgrönland-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "JDT": "Japanische Sommerzeit", "EAT": "Ostafrikanische Zeit", "TMT": "Turkmenistan-Normalzeit", "COST": "Kolumbianische Sommerzeit", "CHADT": "Chatham-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "MST": "Macau-Normalzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "ARST": "Argentinische Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "AST": "Atlantik-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "WIB": "Westindonesische Zeit", "ACST": "Zentralaustralische Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "COT": "Kolumbianische Normalzeit", "ADT": "Atlantik-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "HKT": "Hongkong-Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "MDT": "Macau-Sommerzeit", "GYT": "Guyana-Zeit", "HNCU": "Kubanische Normalzeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "HKST": "Hongkong-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "AWDT": "Westaustralische Sommerzeit", "NZST": "Neuseeland-Normalzeit", "HNT": "Neufundland-Normalzeit", "HAT": "Neufundland-Sommerzeit", "CAT": "Zentralafrikanische Zeit", "ART": "Argentinische Normalzeit", "HECU": "Kubanische Sommerzeit", "SGT": "Singapur-Zeit", "CLT": "Chilenische Normalzeit", "UYST": "Uruguayanische Sommerzeit", "CHAST": "Chatham-Normalzeit", "AEST": "Ostaustralische Normalzeit", "JST": "Japanische Normalzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_IT) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_IT'
+func (de *de_IT) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_IT'
+func (de *de_IT) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_IT'
+func (de *de_IT) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_IT'
+func (de *de_IT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_IT'
+func (de *de_IT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_IT'
+func (de *de_IT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_IT) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_IT) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_IT) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_IT) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_IT) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_IT) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_IT) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_IT) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_IT) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_IT) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_IT) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_IT) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_IT) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_IT) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_IT) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_IT) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_IT) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_IT' and handles both Whole and Real numbers based on 'v'
+func (de *de_IT) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_IT' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_IT) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_IT'
+func (de *de_IT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, de.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_IT'
+// in accounting notation.
+func (de *de_IT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, de.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, de.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, de.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_IT'
+func (de *de_IT) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_IT'
+func (de *de_IT) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_IT'
+func (de *de_IT) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_IT'
+func (de *de_IT) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_IT'
+func (de *de_IT) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_IT'
+func (de *de_IT) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_IT'
+func (de *de_IT) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_IT'
+func (de *de_IT) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_IT/de_IT_test.go b/vendor/github.com/go-playground/locales/de_IT/de_IT_test.go
new file mode 100644
index 000000000..e8904680a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_IT/de_IT_test.go
@@ -0,0 +1,1120 @@
+package de_IT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_IT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_LI/de_LI.go b/vendor/github.com/go-playground/locales/de_LI/de_LI.go
new file mode 100644
index 000000000..bbb10b20c
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_LI/de_LI.go
@@ -0,0 +1,644 @@
+package de_LI
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_LI struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositivePrefix string
+ currencyNegativePrefix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_LI' locale
+func New() locales.Translator {
+ return &de_LI{
+ locale: "de_LI",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ".",
+ group: "’",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositivePrefix: " ",
+ currencyNegativePrefix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vm.", "nm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"SAST": "Südafrikanische Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "WITA": "Zentralindonesische Zeit", "HNT": "Neufundland-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "BOT": "Bolivianische Zeit", "SGT": "Singapur-Zeit", "HNEG": "Ostgrönland-Normalzeit", "MEZ": "Mitteleuropäische Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "TMST": "Turkmenistan-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "HKT": "Hongkong-Normalzeit", "VET": "Venezuela-Zeit", "CAT": "Zentralafrikanische Zeit", "ART": "Argentinische Normalzeit", "ChST": "Chamorro-Zeit", "BT": "Bhutan-Zeit", "HEEG": "Ostgrönland-Sommerzeit", "HNOG": "Westgrönland-Normalzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "AEST": "Ostaustralische Normalzeit", "JST": "Japanische Normalzeit", "HKST": "Hongkong-Sommerzeit", "IST": "Indische Zeit", "HECU": "Kubanische Sommerzeit", "MESZ": "Mitteleuropäische Sommerzeit", "WARST": "Westargentinische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "NZDT": "Neuseeland-Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "CHADT": "Chatham-Sommerzeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "AST": "Atlantik-Normalzeit", "WESZ": "Westeuropäische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "JDT": "Japanische Sommerzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "WART": "Westargentinische Normalzeit", "MDT": "Macau-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "CLT": "Chilenische Normalzeit", "ARST": "Argentinische Sommerzeit", "CHAST": "Chatham-Normalzeit", "HNCU": "Kubanische Normalzeit", "AWST": "Westaustralische Normalzeit", "ADT": "Atlantik-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "LHST": "Lord-Howe-Normalzeit", "HAT": "Neufundland-Sommerzeit", "WIT": "Ostindonesische Zeit", "GYT": "Guyana-Zeit", "UYT": "Uruguyanische Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "MYT": "Malaysische Zeit", "ECT": "Ecuadorianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "MST": "Macau-Normalzeit", "SRT": "Suriname-Zeit", "TMT": "Turkmenistan-Normalzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "WIB": "Westindonesische Zeit", "AWDT": "Westaustralische Sommerzeit", "AKST": "Alaska-Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "∅∅∅": "Acre-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "AKDT": "Alaska-Sommerzeit", "EAT": "Ostafrikanische Zeit", "CLST": "Chilenische Sommerzeit", "COT": "Kolumbianische Normalzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_LI) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_LI'
+func (de *de_LI) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_LI'
+func (de *de_LI) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_LI'
+func (de *de_LI) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_LI'
+func (de *de_LI) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_LI'
+func (de *de_LI) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_LI'
+func (de *de_LI) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_LI) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_LI) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_LI) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_LI) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_LI) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_LI) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_LI) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_LI) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_LI) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_LI) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_LI) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_LI) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_LI) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_LI) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_LI) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_LI) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_LI) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_LI' and handles both Whole and Real numbers based on 'v'
+func (de *de_LI) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_LI' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_LI) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_LI'
+func (de *de_LI) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_LI'
+// in accounting notation.
+func (de *de_LI) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 3*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(de.group) - 1; j >= 0; j-- {
+ b = append(b, de.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyNegativePrefix[j])
+ }
+
+ b = append(b, de.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
+ b = append(b, de.currencyPositivePrefix[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_LI'
+func (de *de_LI) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_LI'
+func (de *de_LI) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_LI'
+func (de *de_LI) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_LI'
+func (de *de_LI) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_LI'
+func (de *de_LI) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_LI'
+func (de *de_LI) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_LI'
+func (de *de_LI) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_LI'
+func (de *de_LI) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_LI/de_LI_test.go b/vendor/github.com/go-playground/locales/de_LI/de_LI_test.go
new file mode 100644
index 000000000..83e75bf38
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_LI/de_LI_test.go
@@ -0,0 +1,1120 @@
+package de_LI
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_LI"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/de_LU/de_LU.go b/vendor/github.com/go-playground/locales/de_LU/de_LU.go
new file mode 100644
index 000000000..e5d1c35cc
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_LU/de_LU.go
@@ -0,0 +1,629 @@
+package de_LU
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type de_LU struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'de_LU' locale
+func New() locales.Translator {
+ return &de_LU{
+ locale: "de_LU",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: []locales.PluralRule{2, 6},
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "F", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Jan.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
+ monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
+ daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
+ daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
+ daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
+ periodsAbbreviated: []string{"vorm.", "nachm."},
+ periodsNarrow: []string{"vorm.", "nachm."},
+ periodsWide: []string{"vorm.", "nachm."},
+ erasAbbreviated: []string{"v. Chr.", "n. Chr."},
+ erasNarrow: []string{"v. Chr.", "n. Chr."},
+ erasWide: []string{"v. Chr.", "n. Chr."},
+ timezones: map[string]string{"HAT": "Neufundland-Sommerzeit", "ART": "Argentinische Normalzeit", "GYT": "Guyana-Zeit", "AWDT": "Westaustralische Sommerzeit", "AKST": "Alaska-Normalzeit", "ChST": "Chamorro-Zeit", "CHAST": "Chatham-Normalzeit", "CLST": "Chilenische Sommerzeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "GMT": "Mittlere Greenwich-Zeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "BOT": "Bolivianische Zeit", "JST": "Japanische Normalzeit", "IST": "Indische Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "OEZ": "Osteuropäische Normalzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "UYST": "Uruguayanische Sommerzeit", "AWST": "Westaustralische Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "LHST": "Lord-Howe-Normalzeit", "MDT": "Macau-Sommerzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "WIB": "Westindonesische Zeit", "ACST": "Zentralaustralische Normalzeit", "TMST": "Turkmenistan-Sommerzeit", "COST": "Kolumbianische Sommerzeit", "HECU": "Kubanische Sommerzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "BT": "Bhutan-Zeit", "VET": "Venezuela-Zeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "HKST": "Hongkong-Sommerzeit", "WITA": "Zentralindonesische Zeit", "EAT": "Ostafrikanische Zeit", "OESZ": "Osteuropäische Sommerzeit", "MYT": "Malaysische Zeit", "HNOG": "Westgrönland-Normalzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "COT": "Kolumbianische Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "NZDT": "Neuseeland-Sommerzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "CLT": "Chilenische Normalzeit", "ARST": "Argentinische Sommerzeit", "UYT": "Uruguyanische Normalzeit", "CST": "Nordamerikanische Inland-Normalzeit", "WAT": "Westafrikanische Normalzeit", "WAST": "Westafrikanische Sommerzeit", "JDT": "Japanische Sommerzeit", "HNT": "Neufundland-Normalzeit", "HNEG": "Ostgrönland-Normalzeit", "WART": "Westargentinische Normalzeit", "SRT": "Suriname-Zeit", "WESZ": "Westeuropäische Sommerzeit", "GFT": "Französisch-Guayana-Zeit", "ECT": "Ecuadorianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "∅∅∅": "Azoren-Sommerzeit", "WARST": "Westargentinische Sommerzeit", "WIT": "Ostindonesische Zeit", "TMT": "Turkmenistan-Normalzeit", "AKDT": "Alaska-Sommerzeit", "ADT": "Atlantik-Sommerzeit", "SAST": "Südafrikanische Zeit", "HNCU": "Kubanische Normalzeit", "AEST": "Ostaustralische Normalzeit", "SGT": "Singapur-Zeit", "CAT": "Zentralafrikanische Zeit", "CHADT": "Chatham-Sommerzeit", "AEDT": "Ostaustralische Sommerzeit", "WEZ": "Westeuropäische Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "NZST": "Neuseeland-Normalzeit", "HKT": "Hongkong-Normalzeit", "LHDT": "Lord-Howe-Sommerzeit", "MST": "Macau-Normalzeit", "AST": "Atlantik-Normalzeit", "HEEG": "Ostgrönland-Sommerzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (de *de_LU) Locale() string {
+ return de.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'de_LU'
+func (de *de_LU) PluralsCardinal() []locales.PluralRule {
+ return de.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'de_LU'
+func (de *de_LU) PluralsOrdinal() []locales.PluralRule {
+ return de.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'de_LU'
+func (de *de_LU) PluralsRange() []locales.PluralRule {
+ return de.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_LU'
+func (de *de_LU) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+
+ if i == 1 && v == 0 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'de_LU'
+func (de *de_LU) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_LU'
+func (de *de_LU) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+
+ start := de.CardinalPluralRule(num1, v1)
+ end := de.CardinalPluralRule(num2, v2)
+
+ if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
+ return locales.PluralRuleOther
+ } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (de *de_LU) MonthAbbreviated(month time.Month) string {
+ return de.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (de *de_LU) MonthsAbbreviated() []string {
+ return de.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (de *de_LU) MonthNarrow(month time.Month) string {
+ return de.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (de *de_LU) MonthsNarrow() []string {
+ return de.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (de *de_LU) MonthWide(month time.Month) string {
+ return de.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (de *de_LU) MonthsWide() []string {
+ return de.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (de *de_LU) WeekdayAbbreviated(weekday time.Weekday) string {
+ return de.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (de *de_LU) WeekdaysAbbreviated() []string {
+ return de.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (de *de_LU) WeekdayNarrow(weekday time.Weekday) string {
+ return de.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (de *de_LU) WeekdaysNarrow() []string {
+ return de.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (de *de_LU) WeekdayShort(weekday time.Weekday) string {
+ return de.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (de *de_LU) WeekdaysShort() []string {
+ return de.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (de *de_LU) WeekdayWide(weekday time.Weekday) string {
+ return de.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (de *de_LU) WeekdaysWide() []string {
+ return de.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (de *de_LU) Decimal() string {
+ return de.decimal
+}
+
+// Group returns the group of number
+func (de *de_LU) Group() string {
+ return de.group
+}
+
+// Group returns the minus sign of number
+func (de *de_LU) Minus() string {
+ return de.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'de_LU' and handles both Whole and Real numbers based on 'v'
+func (de *de_LU) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'de_LU' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (de *de_LU) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, de.percentSuffix...)
+
+ b = append(b, de.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_LU'
+func (de *de_LU) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, de.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, de.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_LU'
+// in accounting notation.
+func (de *de_LU) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := de.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, de.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, de.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, de.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, de.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, de.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, de.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'de_LU'
+func (de *de_LU) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'de_LU'
+func (de *de_LU) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'de_LU'
+func (de *de_LU) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'de_LU'
+func (de *de_LU) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, de.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, de.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'de_LU'
+func (de *de_LU) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'de_LU'
+func (de *de_LU) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'de_LU'
+func (de *de_LU) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'de_LU'
+func (de *de_LU) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, de.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := de.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/de_LU/de_LU_test.go b/vendor/github.com/go-playground/locales/de_LU/de_LU_test.go
new file mode 100644
index 000000000..caef380b7
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/de_LU/de_LU_test.go
@@ -0,0 +1,1120 @@
+package de_LU
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "de_LU"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dje/dje.go b/vendor/github.com/go-playground/locales/dje/dje.go
new file mode 100644
index 000000000..9ad0390c6
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dje/dje.go
@@ -0,0 +1,578 @@
+package dje
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dje struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dje' locale
+func New() locales.Translator {
+ return &dje{
+ locale: "dje",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "Žan", "Fee", "Mar", "Awi", "Me", "Žuw", "Žuy", "Ut", "Sek", "Okt", "Noo", "Dee"},
+ monthsNarrow: []string{"", "Ž", "F", "M", "A", "M", "Ž", "Ž", "U", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Žanwiye", "Feewiriye", "Marsi", "Awiril", "Me", "Žuweŋ", "Žuyye", "Ut", "Sektanbur", "Oktoobur", "Noowanbur", "Deesanbur"},
+ daysAbbreviated: []string{"Alh", "Ati", "Ata", "Ala", "Alm", "Alz", "Asi"},
+ daysNarrow: []string{"H", "T", "T", "L", "M", "Z", "S"},
+ daysWide: []string{"Alhadi", "Atinni", "Atalaata", "Alarba", "Alhamisi", "Alzuma", "Asibti"},
+ periodsAbbreviated: []string{"Subbaahi", "Zaarikay b"},
+ periodsWide: []string{"Subbaahi", "Zaarikay b"},
+ erasAbbreviated: []string{"IJ", "IZ"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Isaa jine", "Isaa zamanoo"},
+ timezones: map[string]string{"AWDT": "AWDT", "ECT": "ECT", "AKDT": "AKDT", "HNOG": "HNOG", "WITA": "WITA", "HNNOMX": "HNNOMX", "HKST": "HKST", "HADT": "HADT", "UYST": "UYST", "BT": "BT", "HEEG": "HEEG", "ACST": "ACST", "HKT": "HKT", "HEPMX": "HEPMX", "WESZ": "WESZ", "WAT": "WAT", "UYT": "UYT", "HNCU": "HNCU", "MST": "MST", "NZDT": "NZDT", "EST": "EST", "NZST": "NZST", "VET": "VET", "PST": "PST", "AEDT": "AEDT", "MESZ": "MESZ", "WART": "WART", "TMT": "TMT", "ACWDT": "ACWDT", "MEZ": "MEZ", "COST": "COST", "∅∅∅": "∅∅∅", "GMT": "GMT", "CHADT": "CHADT", "AWST": "AWST", "SAST": "SAST", "LHST": "LHST", "WIT": "WIT", "OEZ": "OEZ", "HNPMX": "HNPMX", "AEST": "AEST", "WEZ": "WEZ", "WIB": "WIB", "HAT": "HAT", "MYT": "MYT", "JST": "JST", "EDT": "EDT", "IST": "IST", "HNPM": "HNPM", "HEPM": "HEPM", "CLT": "CLT", "ART": "ART", "ARST": "ARST", "MDT": "MDT", "JDT": "JDT", "HEOG": "HEOG", "WARST": "WARST", "OESZ": "OESZ", "HECU": "HECU", "SGT": "SGT", "HNT": "HNT", "TMST": "TMST", "AST": "AST", "ACWST": "ACWST", "HENOMX": "HENOMX", "CAT": "CAT", "LHDT": "LHDT", "CLST": "CLST", "COT": "COT", "GYT": "GYT", "PDT": "PDT", "WAST": "WAST", "HNEG": "HNEG", "ACDT": "ACDT", "ChST": "ChST", "CST": "CST", "ADT": "ADT", "BOT": "BOT", "AKST": "AKST", "HAST": "HAST", "CHAST": "CHAST", "CDT": "CDT", "GFT": "GFT", "SRT": "SRT", "EAT": "EAT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dje *dje) Locale() string {
+ return dje.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dje'
+func (dje *dje) PluralsCardinal() []locales.PluralRule {
+ return dje.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dje'
+func (dje *dje) PluralsOrdinal() []locales.PluralRule {
+ return dje.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dje'
+func (dje *dje) PluralsRange() []locales.PluralRule {
+ return dje.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dje'
+func (dje *dje) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dje'
+func (dje *dje) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dje'
+func (dje *dje) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dje *dje) MonthAbbreviated(month time.Month) string {
+ return dje.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dje *dje) MonthsAbbreviated() []string {
+ return dje.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dje *dje) MonthNarrow(month time.Month) string {
+ return dje.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dje *dje) MonthsNarrow() []string {
+ return dje.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dje *dje) MonthWide(month time.Month) string {
+ return dje.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dje *dje) MonthsWide() []string {
+ return dje.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dje *dje) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dje.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dje *dje) WeekdaysAbbreviated() []string {
+ return dje.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dje *dje) WeekdayNarrow(weekday time.Weekday) string {
+ return dje.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dje *dje) WeekdaysNarrow() []string {
+ return dje.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dje *dje) WeekdayShort(weekday time.Weekday) string {
+ return dje.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dje *dje) WeekdaysShort() []string {
+ return dje.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dje *dje) WeekdayWide(weekday time.Weekday) string {
+ return dje.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dje *dje) WeekdaysWide() []string {
+ return dje.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dje *dje) Decimal() string {
+ return dje.decimal
+}
+
+// Group returns the group of number
+func (dje *dje) Group() string {
+ return dje.group
+}
+
+// Group returns the minus sign of number
+func (dje *dje) Minus() string {
+ return dje.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dje' and handles both Whole and Real numbers based on 'v'
+func (dje *dje) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dje' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dje *dje) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dje.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dje'
+func (dje *dje) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dje.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dje.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dje'
+// in accounting notation.
+func (dje *dje) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dje.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dje.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dje.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dje'
+func (dje *dje) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dje'
+func (dje *dje) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dje'
+func (dje *dje) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dje'
+func (dje *dje) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dje.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dje'
+func (dje *dje) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dje'
+func (dje *dje) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dje'
+func (dje *dje) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dje'
+func (dje *dje) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dje.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dje/dje_test.go b/vendor/github.com/go-playground/locales/dje/dje_test.go
new file mode 100644
index 000000000..533dcfdce
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dje/dje_test.go
@@ -0,0 +1,1120 @@
+package dje
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dje"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dje_NE/dje_NE.go b/vendor/github.com/go-playground/locales/dje_NE/dje_NE.go
new file mode 100644
index 000000000..45ed6e857
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dje_NE/dje_NE.go
@@ -0,0 +1,578 @@
+package dje_NE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dje_NE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dje_NE' locale
+func New() locales.Translator {
+ return &dje_NE{
+ locale: "dje_NE",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ monthsAbbreviated: []string{"", "Žan", "Fee", "Mar", "Awi", "Me", "Žuw", "Žuy", "Ut", "Sek", "Okt", "Noo", "Dee"},
+ monthsNarrow: []string{"", "Ž", "F", "M", "A", "M", "Ž", "Ž", "U", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Žanwiye", "Feewiriye", "Marsi", "Awiril", "Me", "Žuweŋ", "Žuyye", "Ut", "Sektanbur", "Oktoobur", "Noowanbur", "Deesanbur"},
+ daysAbbreviated: []string{"Alh", "Ati", "Ata", "Ala", "Alm", "Alz", "Asi"},
+ daysNarrow: []string{"H", "T", "T", "L", "M", "Z", "S"},
+ daysWide: []string{"Alhadi", "Atinni", "Atalaata", "Alarba", "Alhamisi", "Alzuma", "Asibti"},
+ periodsAbbreviated: []string{"Subbaahi", "Zaarikay b"},
+ periodsWide: []string{"Subbaahi", "Zaarikay b"},
+ erasAbbreviated: []string{"IJ", "IZ"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Isaa jine", "Isaa zamanoo"},
+ timezones: map[string]string{"AEDT": "AEDT", "BOT": "BOT", "HEEG": "HEEG", "SRT": "SRT", "WAT": "WAT", "SGT": "SGT", "ACWST": "ACWST", "HKT": "HKT", "OEZ": "OEZ", "COST": "COST", "CHAST": "CHAST", "COT": "COT", "ADT": "ADT", "NZDT": "NZDT", "GFT": "GFT", "ACDT": "ACDT", "HNT": "HNT", "HAST": "HAST", "TMST": "TMST", "CDT": "CDT", "PST": "PST", "AST": "AST", "WESZ": "WESZ", "HENOMX": "HENOMX", "EAT": "EAT", "MST": "MST", "WEZ": "WEZ", "VET": "VET", "HNNOMX": "HNNOMX", "HNCU": "HNCU", "CST": "CST", "HKST": "HKST", "LHDT": "LHDT", "WITA": "WITA", "TMT": "TMT", "ART": "ART", "CHADT": "CHADT", "HECU": "HECU", "WIB": "WIB", "NZST": "NZST", "ACST": "ACST", "WARST": "WARST", "ARST": "ARST", "UYT": "UYT", "HADT": "HADT", "HNPMX": "HNPMX", "WAST": "WAST", "JDT": "JDT", "IST": "IST", "WART": "WART", "CAT": "CAT", "AWDT": "AWDT", "EST": "EST", "HNOG": "HNOG", "MEZ": "MEZ", "HAT": "HAT", "SAST": "SAST", "∅∅∅": "∅∅∅", "GYT": "GYT", "AEST": "AEST", "ECT": "ECT", "HEOG": "HEOG", "LHST": "LHST", "BT": "BT", "CLST": "CLST", "PDT": "PDT", "MESZ": "MESZ", "HNPM": "HNPM", "CLT": "CLT", "HEPM": "HEPM", "ChST": "ChST", "HEPMX": "HEPMX", "MYT": "MYT", "JST": "JST", "EDT": "EDT", "ACWDT": "ACWDT", "HNEG": "HNEG", "GMT": "GMT", "UYST": "UYST", "AWST": "AWST", "MDT": "MDT", "AKST": "AKST", "AKDT": "AKDT", "WIT": "WIT", "OESZ": "OESZ"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dje *dje_NE) Locale() string {
+ return dje.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dje_NE'
+func (dje *dje_NE) PluralsCardinal() []locales.PluralRule {
+ return dje.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dje_NE'
+func (dje *dje_NE) PluralsOrdinal() []locales.PluralRule {
+ return dje.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dje_NE'
+func (dje *dje_NE) PluralsRange() []locales.PluralRule {
+ return dje.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dje_NE'
+func (dje *dje_NE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dje_NE'
+func (dje *dje_NE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dje_NE'
+func (dje *dje_NE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dje *dje_NE) MonthAbbreviated(month time.Month) string {
+ return dje.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dje *dje_NE) MonthsAbbreviated() []string {
+ return dje.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dje *dje_NE) MonthNarrow(month time.Month) string {
+ return dje.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dje *dje_NE) MonthsNarrow() []string {
+ return dje.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dje *dje_NE) MonthWide(month time.Month) string {
+ return dje.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dje *dje_NE) MonthsWide() []string {
+ return dje.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dje *dje_NE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dje.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dje *dje_NE) WeekdaysAbbreviated() []string {
+ return dje.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dje *dje_NE) WeekdayNarrow(weekday time.Weekday) string {
+ return dje.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dje *dje_NE) WeekdaysNarrow() []string {
+ return dje.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dje *dje_NE) WeekdayShort(weekday time.Weekday) string {
+ return dje.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dje *dje_NE) WeekdaysShort() []string {
+ return dje.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dje *dje_NE) WeekdayWide(weekday time.Weekday) string {
+ return dje.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dje *dje_NE) WeekdaysWide() []string {
+ return dje.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dje *dje_NE) Decimal() string {
+ return dje.decimal
+}
+
+// Group returns the group of number
+func (dje *dje_NE) Group() string {
+ return dje.group
+}
+
+// Group returns the minus sign of number
+func (dje *dje_NE) Minus() string {
+ return dje.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dje_NE' and handles both Whole and Real numbers based on 'v'
+func (dje *dje_NE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dje_NE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dje *dje_NE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dje.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dje_NE'
+func (dje *dje_NE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dje.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dje.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dje.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dje_NE'
+// in accounting notation.
+func (dje *dje_NE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dje.currencies[currency]
+ l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dje.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dje.group) - 1; j >= 0; j-- {
+ b = append(b, dje.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dje.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dje.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dje.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dje.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dje_NE'
+func (dje *dje_NE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dje.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dje.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dje_NE/dje_NE_test.go b/vendor/github.com/go-playground/locales/dje_NE/dje_NE_test.go
new file mode 100644
index 000000000..1faaeaf38
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dje_NE/dje_NE_test.go
@@ -0,0 +1,1120 @@
+package dje_NE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dje_NE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dsb/dsb.go b/vendor/github.com/go-playground/locales/dsb/dsb.go
new file mode 100644
index 000000000..bc976e0c0
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dsb/dsb.go
@@ -0,0 +1,589 @@
+package dsb
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dsb struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dsb' locale
+func New() locales.Translator {
+ return &dsb{
+ locale: "dsb",
+ pluralsCardinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: nil,
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "zł", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "FCFA", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "CFA", "XPD", "CFPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan.", "feb.", "měr.", "apr.", "maj.", "jun.", "jul.", "awg.", "sep.", "okt.", "now.", "dec."},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januara", "februara", "měrca", "apryla", "maja", "junija", "julija", "awgusta", "septembra", "oktobra", "nowembra", "decembra"},
+ daysAbbreviated: []string{"nje", "pón", "wał", "srj", "stw", "pět", "sob"},
+ daysNarrow: []string{"n", "p", "w", "s", "s", "p", "s"},
+ daysShort: []string{"nj", "pó", "wa", "sr", "st", "pě", "so"},
+ daysWide: []string{"njeźela", "pónjeźele", "wałtora", "srjoda", "stwórtk", "pětk", "sobota"},
+ periodsAbbreviated: []string{"dopołdnja", "wótpołdnja"},
+ periodsNarrow: []string{"dop.", "wótp."},
+ periodsWide: []string{"dopołdnja", "wótpołdnja"},
+ erasAbbreviated: []string{"pś.Chr.n.", "pó Chr.n."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"pśed Kristusowym naroźenim", "pó Kristusowem naroźenju"},
+ timezones: map[string]string{"CLT": "Chilski standardny cas", "HAST": "Hawaiisko-aleutski standardny cas", "LHDT": "lěśojski cas kupy Lord-Howe", "WART": "Pódwjacornoargentinski standardny cas", "HNT": "Nowofundlandski standardny cas", "VET": "Venezuelski cas", "JST": "Japański standardny cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "ACDT": "Srjejźoawstralski lěśojski cas", "HKST": "Hongkongski lěśojski cas", "MDT": "MDT", "CAT": "Srjejźoafriski cas", "UYST": "Uruguayski lěśojski cas", "HNCU": "Kubański standardny cas", "COT": "Kolumbiski standardny cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "HNPMX": "Mexiski pacifiski standardny cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "CHAST": "Chathamski standardny cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "CHADT": "Chathamski lěśojski cas", "SAST": "Pódpołdnjowoafriski cas", "GFT": "Francojskoguyański cas", "HNEG": "Pódzajtšnogrönlandski standardny cas", "LHST": "Standardny cas kupy Lord-Howe", "HEPM": "St.-Pierre-a-Miqueloński lěśojski cas", "EAT": "Pódzajtšnoafriski cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "MESZ": "Srjejźoeuropski lěśojski cas", "NZST": "Nowoseelandski standardny cas", "HNPM": "St.-Pierre-a-Miqueloński standardny cas", "WIT": "Pódzajtšnoindoneski", "AST": "Atlantiski standardny cas", "AEST": "Pódzajtšnoawstralski standardny cas", "MST": "MST", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "ADT": "Atlantiski lěśojski cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "NZDT": "Nowoseelandski lěśojski cas", "SGT": "Singapurski cas", "HNNOMX": "Mexiski dłujkowjacorny standardny cas", "TMT": "Turkmeniski standardny cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "COST": "Kolumbiski lěśojski cas", "ChST": "Chamorrski cas", "JDT": "Japański lěśojski cas", "∅∅∅": "Peruski lěśojski cas", "CLST": "Chilski lěśojski cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "GMT": "Greenwichski cas", "GYT": "Guyański cas", "UYT": "Uruguayski standardny cas", "HECU": "Kubański lěśojski cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "IST": "Indiski cas", "WITA": "Srjejźoindoneski cas", "HENOMX": "Mexiski dłujkowjacorny lěśojski cas", "ART": "Argentinski standardny cas", "BOT": "Boliwiski cas", "HEEG": "Pódzajtšnogrönlandski lěśojski cas", "MYT": "Malajziski cas", "ACST": "Srjejźoawstralski standardny cas", "HEOG": "Pódwjacornogrönlandski lěśojski cas", "HKT": "Hongkongski standardny cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "WEZ": "Pódwjacornoeuropski standardny cas", "WIB": "Pódwjacornoindoneski cas", "BT": "Bhutański cas", "HNOG": "Pódwjacornogrönlandski standardny cas", "ARST": "Argentinski lěśojski cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "AWST": "Pódwjacornoawstralski standardny cas", "AKST": "Alaskojski standardny cas", "AKDT": "Alaskojski lěśojski cas", "ECT": "Ekuadorski cas", "HAT": "Nowofundlandski lěśojski cas", "WAT": "Pódwjacornoafriski standardny cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "MEZ": "Srjejźoeuropski standardny cas", "SRT": "Surinamski cas", "TMST": "Turkmeniski lěśojski cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "HEPMX": "Mexiski pacifiski lěśojski cas"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dsb *dsb) Locale() string {
+ return dsb.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dsb'
+func (dsb *dsb) PluralsCardinal() []locales.PluralRule {
+ return dsb.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dsb'
+func (dsb *dsb) PluralsOrdinal() []locales.PluralRule {
+ return dsb.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dsb'
+func (dsb *dsb) PluralsRange() []locales.PluralRule {
+ return dsb.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dsb'
+func (dsb *dsb) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod100 := i % 100
+ fMod100 := f % 100
+
+ if (v == 0 && iMod100 == 1) || (fMod100 == 1) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod100 == 2) || (fMod100 == 2) {
+ return locales.PluralRuleTwo
+ } else if (v == 0 && iMod100 >= 3 && iMod100 <= 4) || (fMod100 >= 3 && fMod100 <= 4) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dsb'
+func (dsb *dsb) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dsb'
+func (dsb *dsb) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dsb *dsb) MonthAbbreviated(month time.Month) string {
+ return dsb.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dsb *dsb) MonthsAbbreviated() []string {
+ return dsb.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dsb *dsb) MonthNarrow(month time.Month) string {
+ return dsb.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dsb *dsb) MonthsNarrow() []string {
+ return dsb.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dsb *dsb) MonthWide(month time.Month) string {
+ return dsb.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dsb *dsb) MonthsWide() []string {
+ return dsb.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dsb *dsb) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dsb.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dsb *dsb) WeekdaysAbbreviated() []string {
+ return dsb.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dsb *dsb) WeekdayNarrow(weekday time.Weekday) string {
+ return dsb.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dsb *dsb) WeekdaysNarrow() []string {
+ return dsb.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dsb *dsb) WeekdayShort(weekday time.Weekday) string {
+ return dsb.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dsb *dsb) WeekdaysShort() []string {
+ return dsb.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dsb *dsb) WeekdayWide(weekday time.Weekday) string {
+ return dsb.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dsb *dsb) WeekdaysWide() []string {
+ return dsb.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dsb *dsb) Decimal() string {
+ return dsb.decimal
+}
+
+// Group returns the group of number
+func (dsb *dsb) Group() string {
+ return dsb.group
+}
+
+// Group returns the minus sign of number
+func (dsb *dsb) Minus() string {
+ return dsb.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dsb' and handles both Whole and Real numbers based on 'v'
+func (dsb *dsb) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dsb' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dsb *dsb) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dsb.percentSuffix...)
+
+ b = append(b, dsb.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dsb'
+func (dsb *dsb) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dsb.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dsb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dsb.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dsb'
+// in accounting notation.
+func (dsb *dsb) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dsb.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dsb.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dsb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dsb.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dsb.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dsb'
+func (dsb *dsb) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dsb'
+func (dsb *dsb) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dsb'
+func (dsb *dsb) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, dsb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dsb'
+func (dsb *dsb) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dsb.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, dsb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dsb'
+func (dsb *dsb) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dsb'
+func (dsb *dsb) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dsb'
+func (dsb *dsb) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dsb'
+func (dsb *dsb) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dsb.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dsb/dsb_test.go b/vendor/github.com/go-playground/locales/dsb/dsb_test.go
new file mode 100644
index 000000000..d770a8a15
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dsb/dsb_test.go
@@ -0,0 +1,1120 @@
+package dsb
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dsb"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE.go b/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE.go
new file mode 100644
index 000000000..edcc1bdc2
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE.go
@@ -0,0 +1,589 @@
+package dsb_DE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dsb_DE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dsb_DE' locale
+func New() locales.Translator {
+ return &dsb_DE{
+ locale: "dsb_DE",
+ pluralsCardinal: []locales.PluralRule{2, 3, 4, 6},
+ pluralsOrdinal: []locales.PluralRule{6},
+ pluralsRange: nil,
+ decimal: ",",
+ group: ".",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "jan.", "feb.", "měr.", "apr.", "maj.", "jun.", "jul.", "awg.", "sep.", "okt.", "now.", "dec."},
+ monthsNarrow: []string{"", "j", "f", "m", "a", "m", "j", "j", "a", "s", "o", "n", "d"},
+ monthsWide: []string{"", "januara", "februara", "měrca", "apryla", "maja", "junija", "julija", "awgusta", "septembra", "oktobra", "nowembra", "decembra"},
+ daysAbbreviated: []string{"nje", "pón", "wał", "srj", "stw", "pět", "sob"},
+ daysNarrow: []string{"n", "p", "w", "s", "s", "p", "s"},
+ daysShort: []string{"nj", "pó", "wa", "sr", "st", "pě", "so"},
+ daysWide: []string{"njeźela", "pónjeźele", "wałtora", "srjoda", "stwórtk", "pětk", "sobota"},
+ periodsAbbreviated: []string{"dopołdnja", "wótpołdnja"},
+ periodsNarrow: []string{"dop.", "wótp."},
+ periodsWide: []string{"dopołdnja", "wótpołdnja"},
+ erasAbbreviated: []string{"pś.Chr.n.", "pó Chr.n."},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"pśed Kristusowym naroźenim", "pó Kristusowem naroźenju"},
+ timezones: map[string]string{"SRT": "Surinamski cas", "UYT": "Uruguayski standardny cas", "∅∅∅": "Brasília lěśojski cas", "AEST": "Pódzajtšnoawstralski standardny cas", "SAST": "Pódpołdnjowoafriski cas", "WAST": "Pódwjacornoafriski lěśojski cas", "ECT": "Ekuadorski cas", "HEPM": "St.-Pierre-a-Miqueloński lěśojski cas", "TMT": "Turkmeniski standardny cas", "COT": "Kolumbiski standardny cas", "COST": "Kolumbiski lěśojski cas", "OESZ": "Pódzajtšnoeuropski lěśojski cas", "CHADT": "Chathamski lěśojski cas", "JST": "Japański standardny cas", "MEZ": "Srjejźoeuropski standardny cas", "HENOMX": "Mexiski dłujkowjacorny lěśojski cas", "HEPMX": "Mexiski pacifiski lěśojski cas", "AST": "Atlantiski standardny cas", "ACWST": "Srjejźopódwjacorny awstralski standardny cas", "EDT": "Pódpołnocnoameriski pódzajtšny lěśojski cas", "HAST": "Hawaiisko-aleutski standardny cas", "GMT": "Greenwichski cas", "BOT": "Boliwiski cas", "LHDT": "lěśojski cas kupy Lord-Howe", "ADT": "Atlantiski lěśojski cas", "GFT": "Francojskoguyański cas", "NZST": "Nowoseelandski standardny cas", "HEOG": "Pódwjacornogrönlandski lěśojski cas", "HNNOMX": "Mexiski dłujkowjacorny standardny cas", "CST": "Pódpołnocnoameriski centralny standardny cas", "PST": "Pódpołnocnoameriski pacifiski standardny cas", "HKST": "Hongkongski lěśojski cas", "HNT": "Nowofundlandski standardny cas", "CLT": "Chilski standardny cas", "ChST": "Chamorrski cas", "HECU": "Kubański lěśojski cas", "HNPMX": "Mexiski pacifiski standardny cas", "NZDT": "Nowoseelandski lěśojski cas", "HNEG": "Pódzajtšnogrönlandski standardny cas", "ART": "Argentinski standardny cas", "ARST": "Argentinski lěśojski cas", "AEDT": "Pódzajtšnoawstralski lěśojski cas", "ACWDT": "Srjejźopódwjacorny awstralski lěśojski cas", "WART": "Pódwjacornoargentinski standardny cas", "MESZ": "Srjejźoeuropski lěśojski cas", "CDT": "Pódpołnocnoameriski centralny lěśojski cas", "MST": "Pódpołnocnoameriski górski standardny cas", "WESZ": "Pódwjacornoeuropski lěśojski cas", "MYT": "Malajziski cas", "AKST": "Alaskojski standardny cas", "HNOG": "Pódwjacornogrönlandski standardny cas", "EST": "Pódpołnocnoameriski pódzajtšny standardny cas", "AWDT": "Pódwjacornoawstralski lěśojski cas", "WAT": "Pódwjacornoafriski standardny cas", "ACDT": "Srjejźoawstralski lěśojski cas", "WITA": "Srjejźoindoneski cas", "VET": "Venezuelski cas", "WIT": "Pódzajtšnoindoneski", "WEZ": "Pódwjacornoeuropski standardny cas", "AKDT": "Alaskojski lěśojski cas", "HAT": "Nowofundlandski lěśojski cas", "CAT": "Srjejźoafriski cas", "UYST": "Uruguayski lěśojski cas", "ACST": "Srjejźoawstralski standardny cas", "WARST": "Pódwjacornoargentinski lěśojski cas", "IST": "Indiski cas", "HADT": "Hawaiisko-aleutski lěśojski cas", "GYT": "Guyański cas", "HNCU": "Kubański standardny cas", "JDT": "Japański lěśojski cas", "SGT": "Singapurski cas", "CLST": "Chilski lěśojski cas", "PDT": "Pódpołnocnoameriski pacifiski lěśojski cas", "WIB": "Pódwjacornoindoneski cas", "HEEG": "Pódzajtšnogrönlandski lěśojski cas", "HNPM": "St.-Pierre-a-Miqueloński standardny cas", "OEZ": "Pódzajtšnoeuropski standardny cas", "AWST": "Pódwjacornoawstralski standardny cas", "TMST": "Turkmeniski lěśojski cas", "CHAST": "Chathamski standardny cas", "MDT": "Pódpołnocnoameriski górski lěśojski cas", "BT": "Bhutański cas", "HKT": "Hongkongski standardny cas", "LHST": "Standardny cas kupy Lord-Howe", "EAT": "Pódzajtšnoafriski cas"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dsb *dsb_DE) Locale() string {
+ return dsb.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dsb_DE'
+func (dsb *dsb_DE) PluralsCardinal() []locales.PluralRule {
+ return dsb.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dsb_DE'
+func (dsb *dsb_DE) PluralsOrdinal() []locales.PluralRule {
+ return dsb.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dsb_DE'
+func (dsb *dsb_DE) PluralsRange() []locales.PluralRule {
+ return dsb.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dsb_DE'
+func (dsb *dsb_DE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+ i := int64(n)
+ f := locales.F(n, v)
+ iMod100 := i % 100
+ fMod100 := f % 100
+
+ if (v == 0 && iMod100 == 1) || (fMod100 == 1) {
+ return locales.PluralRuleOne
+ } else if (v == 0 && iMod100 == 2) || (fMod100 == 2) {
+ return locales.PluralRuleTwo
+ } else if (v == 0 && iMod100 >= 3 && iMod100 <= 4) || (fMod100 >= 3 && fMod100 <= 4) {
+ return locales.PluralRuleFew
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dsb_DE'
+func (dsb *dsb_DE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dsb_DE'
+func (dsb *dsb_DE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dsb *dsb_DE) MonthAbbreviated(month time.Month) string {
+ return dsb.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dsb *dsb_DE) MonthsAbbreviated() []string {
+ return dsb.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dsb *dsb_DE) MonthNarrow(month time.Month) string {
+ return dsb.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dsb *dsb_DE) MonthsNarrow() []string {
+ return dsb.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dsb *dsb_DE) MonthWide(month time.Month) string {
+ return dsb.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dsb *dsb_DE) MonthsWide() []string {
+ return dsb.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dsb *dsb_DE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dsb.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dsb *dsb_DE) WeekdaysAbbreviated() []string {
+ return dsb.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dsb *dsb_DE) WeekdayNarrow(weekday time.Weekday) string {
+ return dsb.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dsb *dsb_DE) WeekdaysNarrow() []string {
+ return dsb.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dsb *dsb_DE) WeekdayShort(weekday time.Weekday) string {
+ return dsb.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dsb *dsb_DE) WeekdaysShort() []string {
+ return dsb.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dsb *dsb_DE) WeekdayWide(weekday time.Weekday) string {
+ return dsb.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dsb *dsb_DE) WeekdaysWide() []string {
+ return dsb.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dsb *dsb_DE) Decimal() string {
+ return dsb.decimal
+}
+
+// Group returns the group of number
+func (dsb *dsb_DE) Group() string {
+ return dsb.group
+}
+
+// Group returns the minus sign of number
+func (dsb *dsb_DE) Minus() string {
+ return dsb.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dsb_DE' and handles both Whole and Real numbers based on 'v'
+func (dsb *dsb_DE) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dsb_DE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dsb *dsb_DE) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dsb.percentSuffix...)
+
+ b = append(b, dsb.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dsb_DE'
+func (dsb *dsb_DE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dsb.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dsb.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dsb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dsb.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dsb_DE'
+// in accounting notation.
+func (dsb *dsb_DE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dsb.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dsb.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, dsb.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dsb.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dsb.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dsb.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dsb.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2e}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, dsb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dsb.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2e, 0x20}...)
+ b = append(b, dsb.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dsb_DE'
+func (dsb *dsb_DE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dsb.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dsb.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE_test.go b/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE_test.go
new file mode 100644
index 000000000..0f81371eb
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dsb_DE/dsb_DE_test.go
@@ -0,0 +1,1120 @@
+package dsb_DE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dsb_DE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dua/dua.go b/vendor/github.com/go-playground/locales/dua/dua.go
new file mode 100644
index 000000000..58a78024a
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dua/dua.go
@@ -0,0 +1,590 @@
+package dua
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dua struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dua' locale
+func New() locales.Translator {
+ return &dua{
+ locale: "dua",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "di", "ŋgɔn", "sɔŋ", "diɓ", "emi", "esɔ", "mad", "diŋ", "nyɛt", "may", "tin", "elá"},
+ monthsNarrow: []string{"", "d", "ŋ", "s", "d", "e", "e", "m", "d", "n", "m", "t", "e"},
+ monthsWide: []string{"", "dimɔ́di", "ŋgɔndɛ", "sɔŋɛ", "diɓáɓá", "emiasele", "esɔpɛsɔpɛ", "madiɓɛ́díɓɛ́", "diŋgindi", "nyɛtɛki", "mayésɛ́", "tiníní", "eláŋgɛ́"},
+ daysAbbreviated: []string{"ét", "mɔ́s", "kwa", "muk", "ŋgi", "ɗón", "esa"},
+ daysNarrow: []string{"e", "m", "k", "m", "ŋ", "ɗ", "e"},
+ daysWide: []string{"éti", "mɔ́sú", "kwasú", "mukɔ́sú", "ŋgisú", "ɗónɛsú", "esaɓasú"},
+ periodsAbbreviated: []string{"idiɓa", "ebyámu"},
+ periodsWide: []string{"idiɓa", "ebyámu"},
+ erasAbbreviated: []string{"ɓ.Ys", "mb.Ys"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"ɓoso ɓwá yáɓe lá", "mbúsa kwédi a Yés"},
+ timezones: map[string]string{"WITA": "WITA", "HEPM": "HEPM", "SAST": "SAST", "WAST": "WAST", "EDT": "EDT", "MESZ": "MESZ", "UYT": "UYT", "AST": "AST", "BOT": "BOT", "MEZ": "MEZ", "COT": "COT", "PST": "PST", "IST": "IST", "CLST": "CLST", "HKT": "HKT", "LHST": "LHST", "VET": "VET", "HENOMX": "HENOMX", "MST": "MST", "MDT": "MDT", "BT": "BT", "HEOG": "HEOG", "HEPMX": "HEPMX", "AEDT": "AEDT", "HECU": "HECU", "WESZ": "WESZ", "ACWST": "ACWST", "TMST": "TMST", "COST": "COST", "OEZ": "OEZ", "GMT": "GMT", "ChST": "ChST", "JDT": "JDT", "ACDT": "ACDT", "HKST": "HKST", "WARST": "WARST", "HNT": "HNT", "HAT": "HAT", "PDT": "PDT", "AWST": "AWST", "NZST": "NZST", "HNOG": "HNOG", "AEST": "AEST", "HADT": "HADT", "UYST": "UYST", "HEEG": "HEEG", "HNPM": "HNPM", "ART": "ART", "TMT": "TMT", "EAT": "EAT", "WART": "WART", "CDT": "CDT", "CLT": "CLT", "GYT": "GYT", "CHAST": "CHAST", "HNCU": "HNCU", "AWDT": "AWDT", "NZDT": "NZDT", "HNEG": "HNEG", "JST": "JST", "∅∅∅": "∅∅∅", "EST": "EST", "ACWDT": "ACWDT", "HNNOMX": "HNNOMX", "CAT": "CAT", "HAST": "HAST", "CHADT": "CHADT", "SGT": "SGT", "ECT": "ECT", "HNPMX": "HNPMX", "WEZ": "WEZ", "ACST": "ACST", "WIT": "WIT", "WAT": "WAT", "MYT": "MYT", "AKST": "AKST", "GFT": "GFT", "AKDT": "AKDT", "OESZ": "OESZ", "ARST": "ARST", "CST": "CST", "ADT": "ADT", "WIB": "WIB", "LHDT": "LHDT", "SRT": "SRT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dua *dua) Locale() string {
+ return dua.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dua'
+func (dua *dua) PluralsCardinal() []locales.PluralRule {
+ return dua.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dua'
+func (dua *dua) PluralsOrdinal() []locales.PluralRule {
+ return dua.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dua'
+func (dua *dua) PluralsRange() []locales.PluralRule {
+ return dua.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dua'
+func (dua *dua) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dua'
+func (dua *dua) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dua'
+func (dua *dua) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dua *dua) MonthAbbreviated(month time.Month) string {
+ return dua.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dua *dua) MonthsAbbreviated() []string {
+ return dua.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dua *dua) MonthNarrow(month time.Month) string {
+ return dua.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dua *dua) MonthsNarrow() []string {
+ return dua.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dua *dua) MonthWide(month time.Month) string {
+ return dua.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dua *dua) MonthsWide() []string {
+ return dua.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dua *dua) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dua.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dua *dua) WeekdaysAbbreviated() []string {
+ return dua.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dua *dua) WeekdayNarrow(weekday time.Weekday) string {
+ return dua.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dua *dua) WeekdaysNarrow() []string {
+ return dua.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dua *dua) WeekdayShort(weekday time.Weekday) string {
+ return dua.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dua *dua) WeekdaysShort() []string {
+ return dua.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dua *dua) WeekdayWide(weekday time.Weekday) string {
+ return dua.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dua *dua) WeekdaysWide() []string {
+ return dua.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dua *dua) Decimal() string {
+ return dua.decimal
+}
+
+// Group returns the group of number
+func (dua *dua) Group() string {
+ return dua.group
+}
+
+// Group returns the minus sign of number
+func (dua *dua) Minus() string {
+ return dua.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dua' and handles both Whole and Real numbers based on 'v'
+func (dua *dua) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dua' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dua *dua) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dua.percentSuffix...)
+
+ b = append(b, dua.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dua'
+func (dua *dua) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dua.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dua.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dua.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dua'
+// in accounting notation.
+func (dua *dua) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dua.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dua.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dua.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dua.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dua.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dua'
+func (dua *dua) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dua'
+func (dua *dua) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dua'
+func (dua *dua) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dua'
+func (dua *dua) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dua.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dua'
+func (dua *dua) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dua'
+func (dua *dua) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dua'
+func (dua *dua) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dua'
+func (dua *dua) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dua.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dua/dua_test.go b/vendor/github.com/go-playground/locales/dua/dua_test.go
new file mode 100644
index 000000000..358f6a886
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dua/dua_test.go
@@ -0,0 +1,1120 @@
+package dua
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dua"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dua_CM/dua_CM.go b/vendor/github.com/go-playground/locales/dua_CM/dua_CM.go
new file mode 100644
index 000000000..34c2bc6b3
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dua_CM/dua_CM.go
@@ -0,0 +1,590 @@
+package dua_CM
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dua_CM struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dua_CM' locale
+func New() locales.Translator {
+ return &dua_CM{
+ locale: "dua_CM",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "di", "ŋgɔn", "sɔŋ", "diɓ", "emi", "esɔ", "mad", "diŋ", "nyɛt", "may", "tin", "elá"},
+ monthsNarrow: []string{"", "d", "ŋ", "s", "d", "e", "e", "m", "d", "n", "m", "t", "e"},
+ monthsWide: []string{"", "dimɔ́di", "ŋgɔndɛ", "sɔŋɛ", "diɓáɓá", "emiasele", "esɔpɛsɔpɛ", "madiɓɛ́díɓɛ́", "diŋgindi", "nyɛtɛki", "mayésɛ́", "tiníní", "eláŋgɛ́"},
+ daysAbbreviated: []string{"ét", "mɔ́s", "kwa", "muk", "ŋgi", "ɗón", "esa"},
+ daysNarrow: []string{"e", "m", "k", "m", "ŋ", "ɗ", "e"},
+ daysWide: []string{"éti", "mɔ́sú", "kwasú", "mukɔ́sú", "ŋgisú", "ɗónɛsú", "esaɓasú"},
+ periodsAbbreviated: []string{"idiɓa", "ebyámu"},
+ periodsWide: []string{"idiɓa", "ebyámu"},
+ erasAbbreviated: []string{"ɓ.Ys", "mb.Ys"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"ɓoso ɓwá yáɓe lá", "mbúsa kwédi a Yés"},
+ timezones: map[string]string{"MST": "MST", "EAT": "EAT", "EST": "EST", "HEOG": "HEOG", "WARST": "WARST", "IST": "IST", "MEZ": "MEZ", "HENOMX": "HENOMX", "CLT": "CLT", "ART": "ART", "CDT": "CDT", "HEPMX": "HEPMX", "HEEG": "HEEG", "MDT": "MDT", "ARST": "ARST", "BT": "BT", "SGT": "SGT", "ACDT": "ACDT", "HNT": "HNT", "CHAST": "CHAST", "AWDT": "AWDT", "ADT": "ADT", "WAT": "WAT", "JDT": "JDT", "WART": "WART", "HADT": "HADT", "AWST": "AWST", "HKST": "HKST", "CLST": "CLST", "∅∅∅": "∅∅∅", "GYT": "GYT", "BOT": "BOT", "AKDT": "AKDT", "HNPM": "HNPM", "CST": "CST", "AKST": "AKST", "ACWST": "ACWST", "ACWDT": "ACWDT", "LHDT": "LHDT", "HAT": "HAT", "CAT": "CAT", "OEZ": "OEZ", "CHADT": "CHADT", "WITA": "WITA", "ACST": "ACST", "HNEG": "HNEG", "SRT": "SRT", "WIT": "WIT", "TMST": "TMST", "HAST": "HAST", "UYST": "UYST", "ECT": "ECT", "HNNOMX": "HNNOMX", "COT": "COT", "UYT": "UYT", "WEZ": "WEZ", "GFT": "GFT", "JST": "JST", "HNCU": "HNCU", "WAST": "WAST", "NZDT": "NZDT", "HNOG": "HNOG", "VET": "VET", "HNPMX": "HNPMX", "MYT": "MYT", "HEPM": "HEPM", "TMT": "TMT", "COST": "COST", "PDT": "PDT", "AEST": "AEST", "AEDT": "AEDT", "EDT": "EDT", "LHST": "LHST", "GMT": "GMT", "ChST": "ChST", "AST": "AST", "SAST": "SAST", "WESZ": "WESZ", "WIB": "WIB", "OESZ": "OESZ", "HECU": "HECU", "PST": "PST", "NZST": "NZST", "MESZ": "MESZ", "HKT": "HKT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dua *dua_CM) Locale() string {
+ return dua.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dua_CM'
+func (dua *dua_CM) PluralsCardinal() []locales.PluralRule {
+ return dua.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dua_CM'
+func (dua *dua_CM) PluralsOrdinal() []locales.PluralRule {
+ return dua.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dua_CM'
+func (dua *dua_CM) PluralsRange() []locales.PluralRule {
+ return dua.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dua_CM'
+func (dua *dua_CM) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dua_CM'
+func (dua *dua_CM) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dua_CM'
+func (dua *dua_CM) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dua *dua_CM) MonthAbbreviated(month time.Month) string {
+ return dua.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dua *dua_CM) MonthsAbbreviated() []string {
+ return dua.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dua *dua_CM) MonthNarrow(month time.Month) string {
+ return dua.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dua *dua_CM) MonthsNarrow() []string {
+ return dua.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dua *dua_CM) MonthWide(month time.Month) string {
+ return dua.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dua *dua_CM) MonthsWide() []string {
+ return dua.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dua *dua_CM) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dua.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dua *dua_CM) WeekdaysAbbreviated() []string {
+ return dua.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dua *dua_CM) WeekdayNarrow(weekday time.Weekday) string {
+ return dua.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dua *dua_CM) WeekdaysNarrow() []string {
+ return dua.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dua *dua_CM) WeekdayShort(weekday time.Weekday) string {
+ return dua.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dua *dua_CM) WeekdaysShort() []string {
+ return dua.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dua *dua_CM) WeekdayWide(weekday time.Weekday) string {
+ return dua.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dua *dua_CM) WeekdaysWide() []string {
+ return dua.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dua *dua_CM) Decimal() string {
+ return dua.decimal
+}
+
+// Group returns the group of number
+func (dua *dua_CM) Group() string {
+ return dua.group
+}
+
+// Group returns the minus sign of number
+func (dua *dua_CM) Minus() string {
+ return dua.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dua_CM' and handles both Whole and Real numbers based on 'v'
+func (dua *dua_CM) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dua_CM' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dua *dua_CM) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dua.percentSuffix...)
+
+ b = append(b, dua.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dua_CM'
+func (dua *dua_CM) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dua.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dua.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dua.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dua.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dua_CM'
+// in accounting notation.
+func (dua *dua_CM) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dua.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dua.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dua.group) - 1; j >= 0; j-- {
+ b = append(b, dua.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dua.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dua.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dua.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dua.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dua.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dua.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dua_CM'
+func (dua *dua_CM) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dua.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dua.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dua_CM/dua_CM_test.go b/vendor/github.com/go-playground/locales/dua_CM/dua_CM_test.go
new file mode 100644
index 000000000..b0b0d5599
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dua_CM/dua_CM_test.go
@@ -0,0 +1,1120 @@
+package dua_CM
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dua_CM"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dyo/dyo.go b/vendor/github.com/go-playground/locales/dyo/dyo.go
new file mode 100644
index 000000000..1d94e5f3e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dyo/dyo.go
@@ -0,0 +1,584 @@
+package dyo
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dyo struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dyo' locale
+func New() locales.Translator {
+ return &dyo{
+ locale: "dyo",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Sa", "Fe", "Ma", "Ab", "Me", "Su", "Sú", "Ut", "Se", "Ok", "No", "De"},
+ monthsNarrow: []string{"", "S", "F", "M", "A", "M", "S", "S", "U", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Sanvie", "Fébirie", "Mars", "Aburil", "Mee", "Sueŋ", "Súuyee", "Ut", "Settembar", "Oktobar", "Novembar", "Disambar"},
+ daysAbbreviated: []string{"Dim", "Ten", "Tal", "Ala", "Ara", "Arj", "Sib"},
+ daysNarrow: []string{"D", "T", "T", "A", "A", "A", "S"},
+ daysWide: []string{"Dimas", "Teneŋ", "Talata", "Alarbay", "Aramisay", "Arjuma", "Sibiti"},
+ erasAbbreviated: []string{"ArY", "AtY"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ariŋuu Yeesu", "Atooŋe Yeesu"},
+ timezones: map[string]string{"NZDT": "NZDT", "MEZ": "MEZ", "WAST": "WAST", "EST": "EST", "LHDT": "LHDT", "CLT": "CLT", "PDT": "PDT", "HEOG": "HEOG", "CHAST": "CHAST", "HEPMX": "HEPMX", "CDT": "CDT", "MESZ": "MESZ", "ACWST": "ACWST", "WART": "WART", "WITA": "WITA", "MYT": "MYT", "IST": "IST", "TMT": "TMT", "CAT": "CAT", "COT": "COT", "HNCU": "HNCU", "AST": "AST", "HEEG": "HEEG", "∅∅∅": "∅∅∅", "BT": "BT", "ACDT": "ACDT", "MST": "MST", "GMT": "GMT", "ADT": "ADT", "WEZ": "WEZ", "HNOG": "HNOG", "HNT": "HNT", "CLST": "CLST", "TMST": "TMST", "AWST": "AWST", "ACWDT": "ACWDT", "HEPM": "HEPM", "WIT": "WIT", "ART": "ART", "COST": "COST", "CHADT": "CHADT", "HECU": "HECU", "AEDT": "AEDT", "GFT": "GFT", "HNEG": "HNEG", "HNPM": "HNPM", "SRT": "SRT", "EAT": "EAT", "OESZ": "OESZ", "UYST": "UYST", "AWDT": "AWDT", "WAT": "WAT", "AKST": "AKST", "SGT": "SGT", "HKST": "HKST", "HNNOMX": "HNNOMX", "ChST": "ChST", "PST": "PST", "WIB": "WIB", "NZST": "NZST", "ECT": "ECT", "HAT": "HAT", "OEZ": "OEZ", "HAST": "HAST", "CST": "CST", "JST": "JST", "AEST": "AEST", "WESZ": "WESZ", "ACST": "ACST", "HKT": "HKT", "LHST": "LHST", "ARST": "ARST", "UYT": "UYT", "EDT": "EDT", "AKDT": "AKDT", "HENOMX": "HENOMX", "BOT": "BOT", "WARST": "WARST", "VET": "VET", "HADT": "HADT", "HNPMX": "HNPMX", "SAST": "SAST", "MDT": "MDT", "GYT": "GYT", "JDT": "JDT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dyo *dyo) Locale() string {
+ return dyo.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dyo'
+func (dyo *dyo) PluralsCardinal() []locales.PluralRule {
+ return dyo.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dyo'
+func (dyo *dyo) PluralsOrdinal() []locales.PluralRule {
+ return dyo.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dyo'
+func (dyo *dyo) PluralsRange() []locales.PluralRule {
+ return dyo.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dyo'
+func (dyo *dyo) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dyo'
+func (dyo *dyo) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dyo'
+func (dyo *dyo) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dyo *dyo) MonthAbbreviated(month time.Month) string {
+ return dyo.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dyo *dyo) MonthsAbbreviated() []string {
+ return dyo.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dyo *dyo) MonthNarrow(month time.Month) string {
+ return dyo.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dyo *dyo) MonthsNarrow() []string {
+ return dyo.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dyo *dyo) MonthWide(month time.Month) string {
+ return dyo.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dyo *dyo) MonthsWide() []string {
+ return dyo.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dyo *dyo) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dyo.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dyo *dyo) WeekdaysAbbreviated() []string {
+ return dyo.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dyo *dyo) WeekdayNarrow(weekday time.Weekday) string {
+ return dyo.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dyo *dyo) WeekdaysNarrow() []string {
+ return dyo.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dyo *dyo) WeekdayShort(weekday time.Weekday) string {
+ return dyo.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dyo *dyo) WeekdaysShort() []string {
+ return dyo.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dyo *dyo) WeekdayWide(weekday time.Weekday) string {
+ return dyo.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dyo *dyo) WeekdaysWide() []string {
+ return dyo.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dyo *dyo) Decimal() string {
+ return dyo.decimal
+}
+
+// Group returns the group of number
+func (dyo *dyo) Group() string {
+ return dyo.group
+}
+
+// Group returns the minus sign of number
+func (dyo *dyo) Minus() string {
+ return dyo.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dyo' and handles both Whole and Real numbers based on 'v'
+func (dyo *dyo) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dyo' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dyo *dyo) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dyo.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dyo'
+func (dyo *dyo) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dyo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dyo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dyo.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dyo'
+// in accounting notation.
+func (dyo *dyo) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dyo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dyo.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dyo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dyo.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dyo.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dyo'
+func (dyo *dyo) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dyo'
+func (dyo *dyo) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dyo'
+func (dyo *dyo) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dyo'
+func (dyo *dyo) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dyo.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dyo'
+func (dyo *dyo) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dyo'
+func (dyo *dyo) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dyo'
+func (dyo *dyo) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dyo'
+func (dyo *dyo) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dyo.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dyo/dyo_test.go b/vendor/github.com/go-playground/locales/dyo/dyo_test.go
new file mode 100644
index 000000000..f896b316e
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dyo/dyo_test.go
@@ -0,0 +1,1120 @@
+package dyo
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dyo"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN.go b/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN.go
new file mode 100644
index 000000000..f472540ef
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN.go
@@ -0,0 +1,584 @@
+package dyo_SN
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dyo_SN struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyPositiveSuffix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dyo_SN' locale
+func New() locales.Translator {
+ return &dyo_SN{
+ locale: "dyo_SN",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ",",
+ group: " ",
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyPositiveSuffix: " ",
+ currencyNegativeSuffix: " ",
+ monthsAbbreviated: []string{"", "Sa", "Fe", "Ma", "Ab", "Me", "Su", "Sú", "Ut", "Se", "Ok", "No", "De"},
+ monthsNarrow: []string{"", "S", "F", "M", "A", "M", "S", "S", "U", "S", "O", "N", "D"},
+ monthsWide: []string{"", "Sanvie", "Fébirie", "Mars", "Aburil", "Mee", "Sueŋ", "Súuyee", "Ut", "Settembar", "Oktobar", "Novembar", "Disambar"},
+ daysAbbreviated: []string{"Dim", "Ten", "Tal", "Ala", "Ara", "Arj", "Sib"},
+ daysNarrow: []string{"D", "T", "T", "A", "A", "A", "S"},
+ daysWide: []string{"Dimas", "Teneŋ", "Talata", "Alarbay", "Aramisay", "Arjuma", "Sibiti"},
+ erasAbbreviated: []string{"ArY", "AtY"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Ariŋuu Yeesu", "Atooŋe Yeesu"},
+ timezones: map[string]string{"AWST": "AWST", "BOT": "BOT", "HNT": "HNT", "PDT": "PDT", "HAT": "HAT", "OEZ": "OEZ", "GMT": "GMT", "HEPM": "HEPM", "AWDT": "AWDT", "AEST": "AEST", "WEZ": "WEZ", "JDT": "JDT", "ACDT": "ACDT", "MEZ": "MEZ", "HNPM": "HNPM", "TMST": "TMST", "HECU": "HECU", "WIB": "WIB", "HENOMX": "HENOMX", "GYT": "GYT", "HNCU": "HNCU", "MYT": "MYT", "AKDT": "AKDT", "IST": "IST", "MST": "MST", "SGT": "SGT", "ECT": "ECT", "ACWDT": "ACWDT", "MESZ": "MESZ", "UYST": "UYST", "BT": "BT", "CLT": "CLT", "HNPMX": "HNPMX", "SAST": "SAST", "EDT": "EDT", "HKT": "HKT", "EAT": "EAT", "HAST": "HAST", "ChST": "ChST", "CHADT": "CHADT", "AST": "AST", "WAST": "WAST", "WESZ": "WESZ", "WART": "WART", "TMT": "TMT", "CAT": "CAT", "CHAST": "CHAST", "MDT": "MDT", "WAT": "WAT", "GFT": "GFT", "AKST": "AKST", "HNEG": "HNEG", "SRT": "SRT", "CLST": "CLST", "EST": "EST", "HNOG": "HNOG", "∅∅∅": "∅∅∅", "CST": "CST", "PST": "PST", "ADT": "ADT", "NZDT": "NZDT", "ACWST": "ACWST", "HEEG": "HEEG", "LHDT": "LHDT", "ART": "ART", "COST": "COST", "NZST": "NZST", "JST": "JST", "HKST": "HKST", "LHST": "LHST", "WARST": "WARST", "HNNOMX": "HNNOMX", "WIT": "WIT", "VET": "VET", "AEDT": "AEDT", "ACST": "ACST", "HEOG": "HEOG", "HADT": "HADT", "COT": "COT", "UYT": "UYT", "CDT": "CDT", "HEPMX": "HEPMX", "WITA": "WITA", "OESZ": "OESZ", "ARST": "ARST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dyo *dyo_SN) Locale() string {
+ return dyo.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dyo_SN'
+func (dyo *dyo_SN) PluralsCardinal() []locales.PluralRule {
+ return dyo.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dyo_SN'
+func (dyo *dyo_SN) PluralsOrdinal() []locales.PluralRule {
+ return dyo.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dyo_SN'
+func (dyo *dyo_SN) PluralsRange() []locales.PluralRule {
+ return dyo.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dyo_SN'
+func (dyo *dyo_SN) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dyo_SN'
+func (dyo *dyo_SN) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dyo_SN'
+func (dyo *dyo_SN) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dyo *dyo_SN) MonthAbbreviated(month time.Month) string {
+ return dyo.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dyo *dyo_SN) MonthsAbbreviated() []string {
+ return dyo.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dyo *dyo_SN) MonthNarrow(month time.Month) string {
+ return dyo.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dyo *dyo_SN) MonthsNarrow() []string {
+ return dyo.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dyo *dyo_SN) MonthWide(month time.Month) string {
+ return dyo.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dyo *dyo_SN) MonthsWide() []string {
+ return dyo.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dyo *dyo_SN) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dyo.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dyo *dyo_SN) WeekdaysAbbreviated() []string {
+ return dyo.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dyo *dyo_SN) WeekdayNarrow(weekday time.Weekday) string {
+ return dyo.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dyo *dyo_SN) WeekdaysNarrow() []string {
+ return dyo.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dyo *dyo_SN) WeekdayShort(weekday time.Weekday) string {
+ return dyo.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dyo *dyo_SN) WeekdaysShort() []string {
+ return dyo.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dyo *dyo_SN) WeekdayWide(weekday time.Weekday) string {
+ return dyo.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dyo *dyo_SN) WeekdaysWide() []string {
+ return dyo.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dyo *dyo_SN) Decimal() string {
+ return dyo.decimal
+}
+
+// Group returns the group of number
+func (dyo *dyo_SN) Group() string {
+ return dyo.group
+}
+
+// Group returns the minus sign of number
+func (dyo *dyo_SN) Minus() string {
+ return dyo.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dyo_SN' and handles both Whole and Real numbers based on 'v'
+func (dyo *dyo_SN) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dyo_SN' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dyo *dyo_SN) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 1
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dyo.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dyo_SN'
+func (dyo *dyo_SN) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dyo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dyo.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dyo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ b = append(b, dyo.currencyPositiveSuffix...)
+
+ b = append(b, symbol...)
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dyo_SN'
+// in accounting notation.
+func (dyo *dyo_SN) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dyo.currencies[currency]
+ l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dyo.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ for j := len(dyo.group) - 1; j >= 0; j-- {
+ b = append(b, dyo.group[j])
+ }
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ b = append(b, dyo.minus[0])
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dyo.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, dyo.currencyNegativeSuffix...)
+ b = append(b, symbol...)
+ } else {
+
+ b = append(b, dyo.currencyPositiveSuffix...)
+ b = append(b, symbol...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dyo.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, dyo.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dyo_SN'
+func (dyo *dyo_SN) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dyo.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dyo.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN_test.go b/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN_test.go
new file mode 100644
index 000000000..43316545d
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dyo_SN/dyo_SN_test.go
@@ -0,0 +1,1120 @@
+package dyo_SN
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dyo_SN"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dz/dz.go b/vendor/github.com/go-playground/locales/dz/dz.go
new file mode 100644
index 000000000..77c17f882
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dz/dz.go
@@ -0,0 +1,691 @@
+package dz
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dz struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dz' locale
+func New() locales.Translator {
+ return &dz{
+ locale: "dz",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "གྲངས་མེད",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "Nu.", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KR₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "TH฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ monthsAbbreviated: []string{"", "༡", "༢", "༣", "༤", "༥", "༦", "༧", "༨", "༩", "༡༠", "༡༡", "12"},
+ monthsNarrow: []string{"", "༡", "༢", "༣", "4", "༥", "༦", "༧", "༨", "9", "༡༠", "༡༡", "༡༢"},
+ monthsWide: []string{"", "ཟླ་དངཔ་", "ཟླ་གཉིས་པ་", "ཟླ་གསུམ་པ་", "ཟླ་བཞི་པ་", "ཟླ་ལྔ་པ་", "ཟླ་དྲུག་པ", "ཟླ་བདུན་པ་", "ཟླ་བརྒྱད་པ་", "ཟླ་དགུ་པ་", "ཟླ་བཅུ་པ་", "ཟླ་བཅུ་གཅིག་པ་", "ཟླ་བཅུ་གཉིས་པ་"},
+ daysAbbreviated: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
+ daysNarrow: []string{"ཟླ", "མིར", "ལྷག", "ཕུར", "སངྶ", "སྤེན", "ཉི"},
+ daysShort: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
+ daysWide: []string{"གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་", "གཟའ་ཉི་མ་"},
+ periodsAbbreviated: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ periodsNarrow: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ periodsWide: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ erasAbbreviated: []string{"BCE", "CE"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"LHST": "LHST", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "HENOMX": "HENOMX", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "LHDT": "LHDT", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "SGT": "SGT", "HNOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "MST": "MST", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "CHADT": "CHADT", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "MYT": "MYT", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HEPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཉིན་སྲུང་ཆུ་ཚོད", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "CHAST": "CHAST", "HECU": "ཀིའུ་བྷ་ཉིན་སྲུང་ཆུ་ཚོད", "HNPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཚད་ལྡན་ཆུ་ཚོད", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "HNCU": "ཀིའུ་བྷ་ཚད་ལྡན་ཆུ་ཚོད", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HNEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "∅∅∅": "ཨེ་མ་ཛཱོན་བྱཱར་དུས་ཆུ་ཚོད", "GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "HKT": "HKT", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "TMST": "TMST", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "HNNOMX": "HNNOMX", "TMT": "TMT", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "HKST": "HKST", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "ChST": "ChST", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "HNPMX": "HNPMX", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "HEPMX": "HEPMX", "HEOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "MDT": "MDT", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "HEEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dz *dz) Locale() string {
+ return dz.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dz'
+func (dz *dz) PluralsCardinal() []locales.PluralRule {
+ return dz.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dz'
+func (dz *dz) PluralsOrdinal() []locales.PluralRule {
+ return dz.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dz'
+func (dz *dz) PluralsRange() []locales.PluralRule {
+ return dz.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dz'
+func (dz *dz) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dz'
+func (dz *dz) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dz'
+func (dz *dz) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dz *dz) MonthAbbreviated(month time.Month) string {
+ return dz.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dz *dz) MonthsAbbreviated() []string {
+ return dz.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dz *dz) MonthNarrow(month time.Month) string {
+ return dz.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dz *dz) MonthsNarrow() []string {
+ return dz.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dz *dz) MonthWide(month time.Month) string {
+ return dz.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dz *dz) MonthsWide() []string {
+ return dz.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dz *dz) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dz.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dz *dz) WeekdaysAbbreviated() []string {
+ return dz.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dz *dz) WeekdayNarrow(weekday time.Weekday) string {
+ return dz.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dz *dz) WeekdaysNarrow() []string {
+ return dz.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dz *dz) WeekdayShort(weekday time.Weekday) string {
+ return dz.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dz *dz) WeekdaysShort() []string {
+ return dz.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dz *dz) WeekdayWide(weekday time.Weekday) string {
+ return dz.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dz *dz) WeekdaysWide() []string {
+ return dz.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dz *dz) Decimal() string {
+ return dz.decimal
+}
+
+// Group returns the group of number
+func (dz *dz) Group() string {
+ return dz.group
+}
+
+// Group returns the minus sign of number
+func (dz *dz) Minus() string {
+ return dz.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dz' and handles both Whole and Real numbers based on 'v'
+func (dz *dz) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dz' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dz *dz) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dz.percentSuffix...)
+
+ b = append(b, dz.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dz'
+func (dz *dz) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dz.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dz.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dz'
+// in accounting notation.
+func (dz *dz) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dz.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, dz.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dz.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dz'
+func (dz *dz) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dz'
+func (dz *dz) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9f, 0xe0, 0xbe, 0xb3, 0xe0, 0xbc, 0x8b}...)
+ b = append(b, dz.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dz'
+func (dz *dz) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, dz.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dz'
+func (dz *dz) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dz.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, dz.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dz'
+func (dz *dz) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dz'
+func (dz *dz) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dz'
+func (dz *dz) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dz'
+func (dz *dz) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dz.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dz/dz_test.go b/vendor/github.com/go-playground/locales/dz/dz_test.go
new file mode 100644
index 000000000..be0770816
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dz/dz_test.go
@@ -0,0 +1,1120 @@
+package dz
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dz"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/dz_BT/dz_BT.go b/vendor/github.com/go-playground/locales/dz_BT/dz_BT.go
new file mode 100644
index 000000000..b3f5b0f89
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dz_BT/dz_BT.go
@@ -0,0 +1,691 @@
+package dz_BT
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type dz_BT struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ percentSuffix string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'dz_BT' locale
+func New() locales.Translator {
+ return &dz_BT{
+ locale: "dz_BT",
+ pluralsCardinal: []locales.PluralRule{6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "གྲངས་མེད",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ percentSuffix: " ",
+ monthsAbbreviated: []string{"", "༡", "༢", "༣", "༤", "༥", "༦", "༧", "༨", "༩", "༡༠", "༡༡", "12"},
+ monthsNarrow: []string{"", "༡", "༢", "༣", "4", "༥", "༦", "༧", "༨", "9", "༡༠", "༡༡", "༡༢"},
+ monthsWide: []string{"", "ཟླ་དངཔ་", "ཟླ་གཉིས་པ་", "ཟླ་གསུམ་པ་", "ཟླ་བཞི་པ་", "ཟླ་ལྔ་པ་", "ཟླ་དྲུག་པ", "ཟླ་བདུན་པ་", "ཟླ་བརྒྱད་པ་", "ཟླ་དགུ་པ་", "ཟླ་བཅུ་པ་", "ཟླ་བཅུ་གཅིག་པ་", "ཟླ་བཅུ་གཉིས་པ་"},
+ daysAbbreviated: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
+ daysNarrow: []string{"ཟླ", "མིར", "ལྷག", "ཕུར", "སངྶ", "སྤེན", "ཉི"},
+ daysShort: []string{"ཟླ་", "མིར་", "ལྷག་", "ཕུར་", "སངས་", "སྤེན་", "ཉི་"},
+ daysWide: []string{"གཟའ་ཟླ་བ་", "གཟའ་མིག་དམར་", "གཟའ་ལྷག་པ་", "གཟའ་ཕུར་བུ་", "གཟའ་པ་སངས་", "གཟའ་སྤེན་པ་", "གཟའ་ཉི་མ་"},
+ periodsAbbreviated: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ periodsNarrow: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ periodsWide: []string{"སྔ་ཆ་", "ཕྱི་ཆ་"},
+ erasAbbreviated: []string{"BCE", "CE"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"GMT": "གིརིན་ཝིཆ་ལུ་ཡོད་པའི་ཆུ་ཚོད", "HECU": "ཀིའུ་བྷ་ཉིན་སྲུང་ཆུ་ཚོད", "LHST": "LHST", "MDT": "MDT", "TMT": "TMT", "ARST": "ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "AWST": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "COT": "ཀོ་ལོམ་བྷི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "OEZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "AST": "ཨེཊ་ལེན་ཊིཀ་ཚད་ལྡན་ཆུ་ཚོད", "BOT": "བྷོ་ལི་བི་ཡ་ཆུ་ཚོད", "IST": "རྒྱ་གར་ཆུ་ཚོད", "MST": "MST", "SRT": "སུ་རི་ནཱམ་ཆུ་ཚོད", "EAT": "ཤར་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "CLT": "ཅི་ལི་ཚད་ལྡན་ཆུ་ཚོད", "ART": "ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "AEDT": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "AKDT": "ཨ་ལསི་ཀ་ཉིན་སྲུང་ཆུ་ཚོད", "EDT": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "∅∅∅": "ཨེ་མ་ཛཱོན་བྱཱར་དུས་ཆུ་ཚོད", "JDT": "ཇ་པཱན་ཉིན་སྲུང་ཆུ་ཚོད", "BT": "འབྲུག་ཡུལ་ཆུ་ཚོད", "HEOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད", "EST": "བྱང་ཨ་མི་རི་ཀ་ཤར་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "MESZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "ChST": "ChST", "MEZ": "དབུས་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "HEPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཉིན་སྲུང་ཆུ་ཚོད", "TMST": "TMST", "JST": "ཇ་པཱན་ཚད་ལྡན་ཆུ་ཚོད", "HNT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "VET": "བེ་ནི་ཛུ་ཝེ་ལ་ཆུ་ཚོད", "CST": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཚད་ལྡན་ཆུ་ཚོད", "AEST": "ཤར་ཕྱོགས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "AKST": "ཨ་ལསི་ཀ་ཚད་ལྡན་ཆུ་ཚོད", "HNEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "ACST": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "HNPM": "པའི་རི་དང་མི་ཀི་ལཱོན་ཚད་ལྡན་ཆུ་ཚོད", "WIT": "ཤར་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "GYT": "གུ་ཡ་ན་ཆུ་ཚོད", "GFT": "ཕིརེནཅ་གི་ཡ་ན་ཆུ་ཚོད", "ACDT": "དབུས་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "ADT": "ཨེཊ་ལེན་ཊིཀ་ཉིན་སྲུང་ཆུ་ཚོད", "WEZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་ཚད་ལྡན་ཆུ་ཚོད", "WESZ": "ནུབ་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HEEG": "ཤར་ཕྱོགས་གིརིན་ལེནཌ་བྱཱར་དུས་ཆུ་ཚོད", "ACWST": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཚད་ལྡན་ཆུ་ཚོད", "WART": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་ཚད་ལྡན་ཆུ་ཚོད", "HNNOMX": "HNNOMX", "COST": "ཀོ་ལོམ་བྷི་ཡ་བྱཱར་དུས་ཆུ་ཚོད", "HEPMX": "HEPMX", "WIB": "ནུབ་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "WAT": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཚད་ལྡན་ཆུ་ཚོད", "NZDT": "ནིའུ་ཛི་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "HNOG": "ནུབ་ཕྱོགས་གིརིན་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "HKST": "HKST", "WARST": "ནུབ་ཕྱོགས་ཨར་ཇེན་ཊི་ན་བྱཱར་དུས་ཆུ་ཚོད", "CAT": "དབུས་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "UYT": "ཡུ་རུ་གུ་ཝཱའི་ཚད་ལྡན་ཆུ་ཚོད", "CHAST": "CHAST", "CDT": "བྱང་ཨ་མི་རི་ཀ་དབུས་ཕྱོགས་ཉིན་སྲུང་ཆུ་ཚོད", "WAST": "ནུབ་ཕྱོགས་ཨཕ་རི་ཀཱ་བྱཱར་དུས་ཆུ་ཚོད", "SGT": "SGT", "WITA": "དབུས་ཕྱོགས་ཨིན་ཌོ་ནེ་ཤི་ཡ་ཆུ་ཚོད", "HAT": "ནིའུ་ཕའུནཌ་ལེནཌ་ཉིན་སྲུང་ཆུ་ཚོད", "CLST": "ཅི་ལི་བྱཱར་དུས་ཆུ་ཚོད", "UYST": "ཡུ་རུ་གུ་ཝཱའི་བྱཱར་དུས་ཆུ་ཚོད", "PST": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཚད་ལྡན་ཆུ་ཚོད", "SAST": "ལྷོ་ཕྱོགས་ཨཕ་རི་ཀཱ་ཆུ་ཚོད", "ECT": "ཨེ་ཀུ་ཌཽ་ཆུ་ཚོད", "AWDT": "ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "NZST": "ནིའུ་ཛི་ལེནཌ་ཚད་ལྡན་ཆུ་ཚོད", "OESZ": "ཤར་ཕྱོགས་ཡུ་རོ་པེན་བྱཱར་དུས་ཆུ་ཚོད", "HAST": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཚད་ལྡན་ཆུ་ཚོད", "CHADT": "CHADT", "HNCU": "ཀིའུ་བྷ་ཚད་ལྡན་ཆུ་ཚོད", "HNPMX": "HNPMX", "PDT": "བྱང་ཨ་མི་རི་ཀ་པེ་སི་ཕིག་ཉིན་སྲུང་ཆུ་ཚོད", "MYT": "MYT", "LHDT": "LHDT", "HENOMX": "HENOMX", "HADT": "ཧ་ཝའི་-ཨེ་ལིའུ་ཤེན་ཉིན་སྲུང་ཆུ་ཚོད", "ACWDT": "དབུས་ནུབ་ཕྱོགས་ཨཱོས་ཊྲེལ་ལི་ཡ་ཉིན་སྲུང་ཆུ་ཚོད", "HKT": "HKT"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (dz *dz_BT) Locale() string {
+ return dz.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'dz_BT'
+func (dz *dz_BT) PluralsCardinal() []locales.PluralRule {
+ return dz.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'dz_BT'
+func (dz *dz_BT) PluralsOrdinal() []locales.PluralRule {
+ return dz.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'dz_BT'
+func (dz *dz_BT) PluralsRange() []locales.PluralRule {
+ return dz.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'dz_BT'
+func (dz *dz_BT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'dz_BT'
+func (dz *dz_BT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'dz_BT'
+func (dz *dz_BT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (dz *dz_BT) MonthAbbreviated(month time.Month) string {
+ return dz.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (dz *dz_BT) MonthsAbbreviated() []string {
+ return dz.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (dz *dz_BT) MonthNarrow(month time.Month) string {
+ return dz.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (dz *dz_BT) MonthsNarrow() []string {
+ return dz.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (dz *dz_BT) MonthWide(month time.Month) string {
+ return dz.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (dz *dz_BT) MonthsWide() []string {
+ return dz.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (dz *dz_BT) WeekdayAbbreviated(weekday time.Weekday) string {
+ return dz.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (dz *dz_BT) WeekdaysAbbreviated() []string {
+ return dz.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (dz *dz_BT) WeekdayNarrow(weekday time.Weekday) string {
+ return dz.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (dz *dz_BT) WeekdaysNarrow() []string {
+ return dz.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (dz *dz_BT) WeekdayShort(weekday time.Weekday) string {
+ return dz.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (dz *dz_BT) WeekdaysShort() []string {
+ return dz.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (dz *dz_BT) WeekdayWide(weekday time.Weekday) string {
+ return dz.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (dz *dz_BT) WeekdaysWide() []string {
+ return dz.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (dz *dz_BT) Decimal() string {
+ return dz.decimal
+}
+
+// Group returns the group of number
+func (dz *dz_BT) Group() string {
+ return dz.group
+}
+
+// Group returns the minus sign of number
+func (dz *dz_BT) Minus() string {
+ return dz.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'dz_BT' and handles both Whole and Real numbers based on 'v'
+func (dz *dz_BT) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'dz_BT' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (dz *dz_BT) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 5
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, dz.percentSuffix...)
+
+ b = append(b, dz.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'dz_BT'
+func (dz *dz_BT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dz.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, dz.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dz.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'dz_BT'
+// in accounting notation.
+func (dz *dz_BT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := dz.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ inSecondary := false
+ groupThreshold := 3
+
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, dz.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+
+ if count == groupThreshold {
+ b = append(b, dz.group[0])
+ count = 1
+
+ if !inSecondary {
+ inSecondary = true
+ groupThreshold = 2
+ }
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, dz.minus[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, dz.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2d}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9f, 0xe0, 0xbe, 0xb3, 0xe0, 0xbc, 0x8b}...)
+ b = append(b, dz.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, dz.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, dz.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0xa4, 0xe0, 0xbe, 0xb1, 0xe0, 0xbd, 0xb2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0xa3, 0xe0, 0xbd, 0xbc, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ b = append(b, []byte{0x20}...)
+ b = append(b, dz.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xba, 0xe0, 0xbd, 0xa6, 0xe0, 0xbc, 0x8b}...)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'dz_BT'
+func (dz *dz_BT) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, []byte{0xe0, 0xbd, 0x86, 0xe0, 0xbd, 0xb4, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x9a, 0xe0, 0xbd, 0xbc, 0xe0, 0xbd, 0x91, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, []byte{0x20, 0xe0, 0xbd, 0xa6, 0xe0, 0xbe, 0x90, 0xe0, 0xbd, 0xa2, 0xe0, 0xbc, 0x8b, 0xe0, 0xbd, 0x98, 0xe0, 0xbc, 0x8b, 0x20}...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, dz.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ if t.Hour() < 12 {
+ b = append(b, dz.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, dz.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := dz.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/dz_BT/dz_BT_test.go b/vendor/github.com/go-playground/locales/dz_BT/dz_BT_test.go
new file mode 100644
index 000000000..f993342f9
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/dz_BT/dz_BT_test.go
@@ -0,0 +1,1120 @@
+package dz_BT
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "dz_BT"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ebu/ebu.go b/vendor/github.com/go-playground/locales/ebu/ebu.go
new file mode 100644
index 000000000..71ad2d406
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ebu/ebu.go
@@ -0,0 +1,533 @@
+package ebu
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ebu struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ebu' locale
+func New() locales.Translator {
+ return &ebu{
+ locale: "ebu",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "Ksh", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Mbe", "Kai", "Kat", "Kan", "Gat", "Gan", "Mug", "Knn", "Ken", "Iku", "Imw", "Igi"},
+ monthsNarrow: []string{"", "M", "K", "K", "K", "G", "G", "M", "K", "K", "I", "I", "I"},
+ monthsWide: []string{"", "Mweri wa mbere", "Mweri wa kaĩri", "Mweri wa kathatũ", "Mweri wa kana", "Mweri wa gatano", "Mweri wa gatantatũ", "Mweri wa mũgwanja", "Mweri wa kanana", "Mweri wa kenda", "Mweri wa ikũmi", "Mweri wa ikũmi na ũmwe", "Mweri wa ikũmi na Kaĩrĩ"},
+ daysAbbreviated: []string{"Kma", "Tat", "Ine", "Tan", "Arm", "Maa", "NMM"},
+ daysNarrow: []string{"K", "N", "N", "N", "A", "M", "N"},
+ daysWide: []string{"Kiumia", "Njumatatu", "Njumaine", "Njumatano", "Aramithi", "Njumaa", "NJumamothii"},
+ periodsAbbreviated: []string{"KI", "UT"},
+ periodsWide: []string{"KI", "UT"},
+ erasAbbreviated: []string{"MK", "TK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
+ timezones: map[string]string{"AKDT": "AKDT", "EDT": "EDT", "WART": "WART", "HAT": "HAT", "EAT": "EAT", "HAST": "HAST", "ChST": "ChST", "HNPMX": "HNPMX", "COT": "COT", "AWDT": "AWDT", "BT": "BT", "WIT": "WIT", "GMT": "GMT", "MDT": "MDT", "ECT": "ECT", "MESZ": "MESZ", "IST": "IST", "AWST": "AWST", "NZST": "NZST", "ACWST": "ACWST", "HADT": "HADT", "AST": "AST", "ACST": "ACST", "HNEG": "HNEG", "EST": "EST", "HNPM": "HNPM", "HEPM": "HEPM", "WITA": "WITA", "CST": "CST", "MYT": "MYT", "AKST": "AKST", "MST": "MST", "JST": "JST", "HENOMX": "HENOMX", "SRT": "SRT", "UYST": "UYST", "CHAST": "CHAST", "AEDT": "AEDT", "GYT": "GYT", "HECU": "HECU", "SAST": "SAST", "HNT": "HNT", "CLT": "CLT", "HEPMX": "HEPMX", "WEZ": "WEZ", "VET": "VET", "PDT": "PDT", "WAT": "WAT", "OEZ": "OEZ", "HNCU": "HNCU", "PST": "PST", "HNOG": "HNOG", "HKT": "HKT", "LHST": "LHST", "CAT": "CAT", "ARST": "ARST", "NZDT": "NZDT", "ACWDT": "ACWDT", "WIB": "WIB", "JDT": "JDT", "SGT": "SGT", "LHDT": "LHDT", "HNNOMX": "HNNOMX", "ART": "ART", "ADT": "ADT", "WAST": "WAST", "CLST": "CLST", "MEZ": "MEZ", "OESZ": "OESZ", "BOT": "BOT", "GFT": "GFT", "CHADT": "CHADT", "CDT": "CDT", "ACDT": "ACDT", "HEOG": "HEOG", "HKST": "HKST", "COST": "COST", "∅∅∅": "∅∅∅", "UYT": "UYT", "TMT": "TMT", "WARST": "WARST", "TMST": "TMST", "AEST": "AEST", "WESZ": "WESZ", "HEEG": "HEEG"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ebu *ebu) Locale() string {
+ return ebu.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ebu'
+func (ebu *ebu) PluralsCardinal() []locales.PluralRule {
+ return ebu.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ebu'
+func (ebu *ebu) PluralsOrdinal() []locales.PluralRule {
+ return ebu.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ebu'
+func (ebu *ebu) PluralsRange() []locales.PluralRule {
+ return ebu.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ebu'
+func (ebu *ebu) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ebu'
+func (ebu *ebu) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ebu'
+func (ebu *ebu) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ebu *ebu) MonthAbbreviated(month time.Month) string {
+ return ebu.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ebu *ebu) MonthsAbbreviated() []string {
+ return ebu.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ebu *ebu) MonthNarrow(month time.Month) string {
+ return ebu.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ebu *ebu) MonthsNarrow() []string {
+ return ebu.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ebu *ebu) MonthWide(month time.Month) string {
+ return ebu.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ebu *ebu) MonthsWide() []string {
+ return ebu.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ebu *ebu) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ebu.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ebu *ebu) WeekdaysAbbreviated() []string {
+ return ebu.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ebu *ebu) WeekdayNarrow(weekday time.Weekday) string {
+ return ebu.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ebu *ebu) WeekdaysNarrow() []string {
+ return ebu.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ebu *ebu) WeekdayShort(weekday time.Weekday) string {
+ return ebu.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ebu *ebu) WeekdaysShort() []string {
+ return ebu.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ebu *ebu) WeekdayWide(weekday time.Weekday) string {
+ return ebu.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ebu *ebu) WeekdaysWide() []string {
+ return ebu.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ebu *ebu) Decimal() string {
+ return ebu.decimal
+}
+
+// Group returns the group of number
+func (ebu *ebu) Group() string {
+ return ebu.group
+}
+
+// Group returns the minus sign of number
+func (ebu *ebu) Minus() string {
+ return ebu.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ebu' and handles both Whole and Real numbers based on 'v'
+func (ebu *ebu) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ebu' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ebu *ebu) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ebu'
+func (ebu *ebu) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ebu.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ebu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ebu.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ebu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ebu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ebu'
+// in accounting notation.
+func (ebu *ebu) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ebu.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ebu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ebu.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ebu.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ebu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ebu.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ebu'
+func (ebu *ebu) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ebu'
+func (ebu *ebu) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ebu'
+func (ebu *ebu) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ebu'
+func (ebu *ebu) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ebu.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ebu'
+func (ebu *ebu) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ebu'
+func (ebu *ebu) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ebu'
+func (ebu *ebu) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ebu'
+func (ebu *ebu) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ebu.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ebu/ebu_test.go b/vendor/github.com/go-playground/locales/ebu/ebu_test.go
new file mode 100644
index 000000000..46011e5a7
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ebu/ebu_test.go
@@ -0,0 +1,1120 @@
+package ebu
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ebu"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE.go b/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE.go
new file mode 100644
index 000000000..098081e48
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE.go
@@ -0,0 +1,533 @@
+package ebu_KE
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ebu_KE struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ebu_KE' locale
+func New() locales.Translator {
+ return &ebu_KE{
+ locale: "ebu_KE",
+ pluralsCardinal: nil,
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ timeSeparator: ":",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "Mbe", "Kai", "Kat", "Kan", "Gat", "Gan", "Mug", "Knn", "Ken", "Iku", "Imw", "Igi"},
+ monthsNarrow: []string{"", "M", "K", "K", "K", "G", "G", "M", "K", "K", "I", "I", "I"},
+ monthsWide: []string{"", "Mweri wa mbere", "Mweri wa kaĩri", "Mweri wa kathatũ", "Mweri wa kana", "Mweri wa gatano", "Mweri wa gatantatũ", "Mweri wa mũgwanja", "Mweri wa kanana", "Mweri wa kenda", "Mweri wa ikũmi", "Mweri wa ikũmi na ũmwe", "Mweri wa ikũmi na Kaĩrĩ"},
+ daysAbbreviated: []string{"Kma", "Tat", "Ine", "Tan", "Arm", "Maa", "NMM"},
+ daysNarrow: []string{"K", "N", "N", "N", "A", "M", "N"},
+ daysWide: []string{"Kiumia", "Njumatatu", "Njumaine", "Njumatano", "Aramithi", "Njumaa", "NJumamothii"},
+ periodsAbbreviated: []string{"KI", "UT"},
+ periodsWide: []string{"KI", "UT"},
+ erasAbbreviated: []string{"MK", "TK"},
+ erasNarrow: []string{"", ""},
+ erasWide: []string{"Mbere ya Kristo", "Thutha wa Kristo"},
+ timezones: map[string]string{"BT": "BT", "GFT": "GFT", "JST": "JST", "MESZ": "MESZ", "ARST": "ARST", "AWDT": "AWDT", "WAST": "WAST", "ACWST": "ACWST", "HEOG": "HEOG", "CAT": "CAT", "OESZ": "OESZ", "COT": "COT", "GYT": "GYT", "ADT": "ADT", "AKST": "AKST", "HNEG": "HNEG", "VET": "VET", "HENOMX": "HENOMX", "WIT": "WIT", "UYST": "UYST", "PST": "PST", "ACDT": "ACDT", "ECT": "ECT", "EDT": "EDT", "SRT": "SRT", "EAT": "EAT", "TMT": "TMT", "∅∅∅": "∅∅∅", "AKDT": "AKDT", "WIB": "WIB", "UYT": "UYT", "HEEG": "HEEG", "HKT": "HKT", "HADT": "HADT", "ART": "ART", "COST": "COST", "AST": "AST", "LHDT": "LHDT", "CDT": "CDT", "HEPMX": "HEPMX", "WESZ": "WESZ", "NZDT": "NZDT", "BOT": "BOT", "OEZ": "OEZ", "ChST": "ChST", "CST": "CST", "GMT": "GMT", "LHST": "LHST", "HNT": "HNT", "HECU": "HECU", "HNOG": "HNOG", "HAT": "HAT", "HNPM": "HNPM", "HAST": "HAST", "EST": "EST", "WART": "WART", "CLST": "CLST", "CHADT": "CHADT", "CLT": "CLT", "NZST": "NZST", "HEPM": "HEPM", "CHAST": "CHAST", "WAT": "WAT", "SAST": "SAST", "JDT": "JDT", "ACST": "ACST", "HKST": "HKST", "WARST": "WARST", "TMST": "TMST", "AEST": "AEST", "MST": "MST", "AWST": "AWST", "HNPMX": "HNPMX", "WEZ": "WEZ", "MYT": "MYT", "WITA": "WITA", "HNCU": "HNCU", "PDT": "PDT", "SGT": "SGT", "ACWDT": "ACWDT", "HNNOMX": "HNNOMX", "AEDT": "AEDT", "MDT": "MDT", "MEZ": "MEZ", "IST": "IST"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ebu *ebu_KE) Locale() string {
+ return ebu.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ebu_KE'
+func (ebu *ebu_KE) PluralsCardinal() []locales.PluralRule {
+ return ebu.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ebu_KE'
+func (ebu *ebu_KE) PluralsOrdinal() []locales.PluralRule {
+ return ebu.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ebu_KE'
+func (ebu *ebu_KE) PluralsRange() []locales.PluralRule {
+ return ebu.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ebu_KE'
+func (ebu *ebu_KE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ebu_KE'
+func (ebu *ebu_KE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ebu_KE'
+func (ebu *ebu_KE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ebu *ebu_KE) MonthAbbreviated(month time.Month) string {
+ return ebu.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ebu *ebu_KE) MonthsAbbreviated() []string {
+ return ebu.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ebu *ebu_KE) MonthNarrow(month time.Month) string {
+ return ebu.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ebu *ebu_KE) MonthsNarrow() []string {
+ return ebu.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ebu *ebu_KE) MonthWide(month time.Month) string {
+ return ebu.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ebu *ebu_KE) MonthsWide() []string {
+ return ebu.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ebu *ebu_KE) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ebu.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ebu *ebu_KE) WeekdaysAbbreviated() []string {
+ return ebu.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ebu *ebu_KE) WeekdayNarrow(weekday time.Weekday) string {
+ return ebu.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ebu *ebu_KE) WeekdaysNarrow() []string {
+ return ebu.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ebu *ebu_KE) WeekdayShort(weekday time.Weekday) string {
+ return ebu.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ebu *ebu_KE) WeekdaysShort() []string {
+ return ebu.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ebu *ebu_KE) WeekdayWide(weekday time.Weekday) string {
+ return ebu.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ebu *ebu_KE) WeekdaysWide() []string {
+ return ebu.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ebu *ebu_KE) Decimal() string {
+ return ebu.decimal
+}
+
+// Group returns the group of number
+func (ebu *ebu_KE) Group() string {
+ return ebu.group
+}
+
+// Group returns the minus sign of number
+func (ebu *ebu_KE) Minus() string {
+ return ebu.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ebu_KE' and handles both Whole and Real numbers based on 'v'
+func (ebu *ebu_KE) FmtNumber(num float64, v uint64) string {
+
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ebu_KE' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ebu *ebu_KE) FmtPercent(num float64, v uint64) string {
+ return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ebu_KE'
+func (ebu *ebu_KE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ebu.currencies[currency]
+ l := len(s) + len(symbol) + 0
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ebu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ebu.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ebu.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ebu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ebu_KE'
+// in accounting notation.
+func (ebu *ebu_KE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ebu.currencies[currency]
+ l := len(s) + len(symbol) + 2
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ebu.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ebu.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ebu.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ebu.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ebu.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Day() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Month() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ebu.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20}...)
+ b = append(b, ebu.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ebu_KE'
+func (ebu *ebu_KE) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Hour()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ebu.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ebu.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE_test.go b/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE_test.go
new file mode 100644
index 000000000..58eeae612
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ebu_KE/ebu_KE_test.go
@@ -0,0 +1,1120 @@
+package ebu_KE
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ebu_KE"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ee/ee.go b/vendor/github.com/go-playground/locales/ee/ee.go
new file mode 100644
index 000000000..aa90acae9
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ee/ee.go
@@ -0,0 +1,645 @@
+package ee
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ee struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ee' locale
+func New() locales.Translator {
+ return &ee{
+ locale: "ee",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AU$", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "R$", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CA$", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CN¥", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "€", "FIM", "FJD", "FKP", "FRF", "£", "GEK", "GEL", "GHC", "GH₵", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HK$", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "₪", "₹", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JP¥", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "₩", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MX$", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZ$", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "฿", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "NT$", "TZS", "UAH", "UAK", "UGS", "UGX", "US$", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "₫", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "EC$", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "dzv", "dzd", "ted", "afɔ", "dam", "mas", "sia", "dea", "any", "kel", "ade", "dzm"},
+ monthsNarrow: []string{"", "d", "d", "t", "a", "d", "m", "s", "d", "a", "k", "a", "d"},
+ monthsWide: []string{"", "dzove", "dzodze", "tedoxe", "afɔfĩe", "dama", "masa", "siamlɔm", "deasiamime", "anyɔnyɔ", "kele", "adeɛmekpɔxe", "dzome"},
+ daysAbbreviated: []string{"kɔs", "dzo", "bla", "kuɖ", "yaw", "fiɖ", "mem"},
+ daysNarrow: []string{"k", "d", "b", "k", "y", "f", "m"},
+ daysShort: []string{"kɔs", "dzo", "bla", "kuɖ", "yaw", "fiɖ", "mem"},
+ daysWide: []string{"kɔsiɖa", "dzoɖa", "blaɖa", "kuɖa", "yawoɖa", "fiɖa", "memleɖa"},
+ periodsAbbreviated: []string{"ŋdi", "ɣetrɔ"},
+ periodsNarrow: []string{"ŋ", "ɣ"},
+ periodsWide: []string{"ŋdi", "ɣetrɔ"},
+ erasAbbreviated: []string{"HYV", "Yŋ"},
+ erasNarrow: []string{"hY", "Yŋ"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒo me", "TMST": "Turkmenistan dzomeŋɔli gaƒoƒo me", "ART": "Argentina nutome gaƒoƒo me", "CDT": "Titina America kele gaƒoƒo me", "JST": "Japan nutome gaƒoƒo me", "AKST": "Alaska nutome gaƒoƒo me", "HEEG": "East Greenland dzomeŋɔli gaƒoƒo me", "HEPM": "St. Pierre & Miquelon kele gaƒoƒome", "HNT": "Newfoundland nutome gaƒoƒome", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "MYT": "Malaysia gaƒoƒo me", "CLT": "Chile nutome gaƒoƒo me", "HAST": "Hawaii-Aleutia nutome gaƒoƒo me", "CHAST": "Chatham nutome gaƒoƒo me", "AEST": "Australian Eastern nutome gaƒoƒo me", "WAST": "West Africa dzomeŋɔli gaƒoƒo me", "WART": "Ɣetoɖoƒe Argentina nutome gaƒoƒo me", "HEPMX": "Mexican Pacific kele gaƒoƒome", "WAT": "West Africa nutome gaƒoƒo me", "NZDT": "New Zealand kele gaƒoƒo me", "HENOMX": "Northwest Mexico kele gaƒoƒo me", "CLST": "Chile dzomeŋɔli gaƒoƒo me", "ARST": "Argentina dzomeŋɔli gaƒoƒo me", "HADT": "Hawaii-Aleutia kele gaƒoƒo me", "GMT": "Greenwich gaƒoƒo me", "WEZ": "Western Europe nutome gaƒoƒo me", "ECT": "Ecuador gaƒoƒo me", "LHDT": "Lord Howe kele gaƒoƒo me", "EDT": "Eastern America kele gaƒoƒo me", "WITA": "Central Indonesia gaƒoƒo me", "UYST": "Uruguay dzomeŋɔli gaƒoƒo me", "∅∅∅": "Azores dzomeŋɔli gaƒoƒo me", "HAT": "Newfoundland kele gaƒoƒome", "COST": "Colombia dzomeŋɔli gaƒoƒo me", "CST": "Titina America nutome gaƒoƒo me", "GFT": "French Guiana gaƒoƒo me", "BT": "Bhutan gaƒoƒo me", "BOT": "Bolivia gaƒoƒo me", "SGT": "Singapore nutome gaƒoƒo me", "ACWDT": "Australian Central Western kele gaƒoƒo me", "HKST": "Hong Kong dzomeŋɔli gaƒoƒo me", "CHADT": "Chatham kele gaƒoƒo me", "ADT": "Atlantic kele gaƒoƒome", "WIB": "Western Indonesia gaƒoƒo me", "SRT": "Suriname gaƒoƒome", "AWDT": "Australian Western kele gaƒoƒo me", "EST": "Eastern America nutome gaƒoƒo me", "WIT": "Eastern Indonesia gaƒoƒo me", "AST": "Atlantic nutome gaƒoƒome", "ACWST": "Australian Central Western nutome gaƒoƒo me", "HNEG": "East Greenland nutome gaƒoƒo me", "TMT": "Turkmenistan nutome gaƒoƒo me", "CAT": "Central Africa gaƒoƒo me", "EAT": "East Africa gaƒoƒo me", "ChST": "Chamorro gaƒoƒo me", "HNPMX": "Mexican Pacific nutome gaƒoƒo me", "WESZ": "Western Europe dzomeŋɔli gaƒoƒo me", "AKDT": "Alaska kele gaƒoƒo me", "HNOG": "West Greenland nutome gaƒoƒo me", "MEZ": "Central Europe nutome gaƒoƒo me", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "UYT": "Uruguay nutome gaƒoƒo me", "HECU": "Cuba kele gaƒoƒome", "NZST": "New Zealand nutome gaƒoƒo me", "AWST": "Australian Western nutome gaƒoƒo me", "PST": "Pacific nutome gaƒoƒo me", "LHST": "Lord Howe nutome gaƒoƒo me", "HNNOMX": "Northwest Mexico nutome gaƒoƒo me", "MDT": "Makau ŋkekeme gaƒoƒome", "COT": "Colombia nutome gaƒoƒo me", "GYT": "Guyana gaƒoƒo me", "HNCU": "Cuba nutome gaƒoƒome", "HEOG": "West Greenland kele gaƒoƒo me", "ACST": "Australian Central nutome gaƒoƒo me", "ACDT": "Australian Central dzomeli gaƒoƒo me", "HKT": "Hong Kong nutome gaƒoƒo me", "MST": "Makau gaƒoƒoɖoanyime", "JDT": "Japan dzomeŋɔli gaƒoƒo me", "SAST": "South Africa nutome gaƒoƒo me", "MESZ": "Central Europe dzomeŋɔli gaƒoƒo me", "IST": "India gaƒoƒo me", "HNPM": "St. Pierre & Miquelon nutome gaƒoƒome", "VET": "Venezuela gaƒoƒo me", "PDT": "Pacific kele gaƒoƒo me", "AEDT": "Australian Eastern kele gaƒoƒo me"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ee *ee) Locale() string {
+ return ee.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ee'
+func (ee *ee) PluralsCardinal() []locales.PluralRule {
+ return ee.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ee'
+func (ee *ee) PluralsOrdinal() []locales.PluralRule {
+ return ee.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ee'
+func (ee *ee) PluralsRange() []locales.PluralRule {
+ return ee.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ee'
+func (ee *ee) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ee'
+func (ee *ee) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ee'
+func (ee *ee) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ee *ee) MonthAbbreviated(month time.Month) string {
+ return ee.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ee *ee) MonthsAbbreviated() []string {
+ return ee.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ee *ee) MonthNarrow(month time.Month) string {
+ return ee.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ee *ee) MonthsNarrow() []string {
+ return ee.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ee *ee) MonthWide(month time.Month) string {
+ return ee.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ee *ee) MonthsWide() []string {
+ return ee.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ee *ee) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ee.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ee *ee) WeekdaysAbbreviated() []string {
+ return ee.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ee *ee) WeekdayNarrow(weekday time.Weekday) string {
+ return ee.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ee *ee) WeekdaysNarrow() []string {
+ return ee.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ee *ee) WeekdayShort(weekday time.Weekday) string {
+ return ee.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ee *ee) WeekdaysShort() []string {
+ return ee.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ee *ee) WeekdayWide(weekday time.Weekday) string {
+ return ee.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ee *ee) WeekdaysWide() []string {
+ return ee.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ee *ee) Decimal() string {
+ return ee.decimal
+}
+
+// Group returns the group of number
+func (ee *ee) Group() string {
+ return ee.group
+}
+
+// Group returns the minus sign of number
+func (ee *ee) Minus() string {
+ return ee.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ee' and handles both Whole and Real numbers based on 'v'
+func (ee *ee) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ee' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ee *ee) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ee.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ee'
+func (ee *ee) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ee.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ee.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ee'
+// in accounting notation.
+func (ee *ee) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ee.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ee.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ee.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ee.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ee'
+func (ee *ee) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ee'
+func (ee *ee) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ee'
+func (ee *ee) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ee'
+func (ee *ee) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, ee.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ee'
+func (ee *ee) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ee'
+func (ee *ee) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ee'
+func (ee *ee) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ee'
+func (ee *ee) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ee.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ee/ee_test.go b/vendor/github.com/go-playground/locales/ee/ee_test.go
new file mode 100644
index 000000000..dd9eb74cf
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ee/ee_test.go
@@ -0,0 +1,1120 @@
+package ee
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ee"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ // fixed := time.FixedZone("OTHER", -4)
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am Eastern Standard Time",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, fixed),
+ // expected: "8:05:01 pm OTHER",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeLong(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '' Got '%s'", err)
+ // }
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, loc),
+ // expected: "9:05:01 am EST",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, loc),
+ // expected: "8:05:01 pm EST",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05:01 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05:01 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 5, 1, 0, time.UTC),
+ // expected: "9:05 am",
+ // },
+ // {
+ // t: time.Date(2016, 02, 03, 20, 5, 1, 0, time.UTC),
+ // expected: "8:05 pm",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtTimeShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateFull(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Wednesday, February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateFull(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateLong(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "February 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateLong(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateMedium(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "Feb 3, 2016",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateMedium(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtDateShort(t *testing.T) {
+
+ tests := []struct {
+ t time.Time
+ expected string
+ }{
+ // {
+ // t: time.Date(2016, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/16",
+ // },
+ // {
+ // t: time.Date(-500, 02, 03, 9, 0, 1, 0, time.UTC),
+ // expected: "2/3/500",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtDateShort(tt.t)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtNumber(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // expected: "1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // expected: "1,123,456.6",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // expected: "221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // expected: "-221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // expected: "0.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtNumber(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtCurrency(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "-$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "-CAD 221,123,456.564",
+ // },
+ // {
+ // num: 0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtCurrency(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtAccounting(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ currency currency.Type
+ expected string
+ }{
+ // {
+ // num: 1123456.5643,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$1,123,456.56",
+ // },
+ // {
+ // num: 1123456.5643,
+ // v: 1,
+ // currency: currency.USD,
+ // expected: "$1,123,456.60",
+ // },
+ // {
+ // num: 221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "$221,123,456.564",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.USD,
+ // expected: "($221,123,456.564)",
+ // },
+ // {
+ // num: -221123456.5643,
+ // v: 3,
+ // currency: currency.CAD,
+ // expected: "(CAD 221,123,456.564)",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.USD,
+ // expected: "$0.00",
+ // },
+ // {
+ // num: -0,
+ // v: 2,
+ // currency: currency.CAD,
+ // expected: "CAD 0.00",
+ // },
+ // {
+ // num: 1.23,
+ // v: 0,
+ // currency: currency.USD,
+ // expected: "$1.00",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtAccounting(tt.num, tt.v, tt.currency)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtPercent(t *testing.T) {
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected string
+ }{
+ // {
+ // num: 15,
+ // v: 0,
+ // expected: "15%",
+ // },
+ // {
+ // num: 15,
+ // v: 2,
+ // expected: "15.00%",
+ // },
+ // {
+ // num: 434.45,
+ // v: 0,
+ // expected: "434%",
+ // },
+ // {
+ // num: 34.4,
+ // v: 2,
+ // expected: "34.40%",
+ // },
+ // {
+ // num: -34,
+ // v: 0,
+ // expected: "-34%",
+ // },
+ }
+
+ trans := New()
+
+ for _, tt := range tests {
+ s := trans.FmtPercent(tt.num, tt.v)
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
diff --git a/vendor/github.com/go-playground/locales/ee_GH/ee_GH.go b/vendor/github.com/go-playground/locales/ee_GH/ee_GH.go
new file mode 100644
index 000000000..4248d0ab4
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ee_GH/ee_GH.go
@@ -0,0 +1,645 @@
+package ee_GH
+
+import (
+ "math"
+ "strconv"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+type ee_GH struct {
+ locale string
+ pluralsCardinal []locales.PluralRule
+ pluralsOrdinal []locales.PluralRule
+ pluralsRange []locales.PluralRule
+ decimal string
+ group string
+ minus string
+ percent string
+ perMille string
+ timeSeparator string
+ inifinity string
+ currencies []string // idx = enum of currency code
+ currencyNegativePrefix string
+ currencyNegativeSuffix string
+ monthsAbbreviated []string
+ monthsNarrow []string
+ monthsWide []string
+ daysAbbreviated []string
+ daysNarrow []string
+ daysShort []string
+ daysWide []string
+ periodsAbbreviated []string
+ periodsNarrow []string
+ periodsShort []string
+ periodsWide []string
+ erasAbbreviated []string
+ erasNarrow []string
+ erasWide []string
+ timezones map[string]string
+}
+
+// New returns a new instance of translator for the 'ee_GH' locale
+func New() locales.Translator {
+ return &ee_GH{
+ locale: "ee_GH",
+ pluralsCardinal: []locales.PluralRule{2, 6},
+ pluralsOrdinal: nil,
+ pluralsRange: nil,
+ decimal: ".",
+ group: ",",
+ minus: "-",
+ percent: "%",
+ perMille: "‰",
+ timeSeparator: ":",
+ inifinity: "∞",
+ currencies: []string{"ADP", "AED", "AFA", "AFN", "ALK", "ALL", "AMD", "ANG", "AOA", "AOK", "AON", "AOR", "ARA", "ARL", "ARM", "ARP", "ARS", "ATS", "AUD", "AWG", "AZM", "AZN", "BAD", "BAM", "BAN", "BBD", "BDT", "BEC", "BEF", "BEL", "BGL", "BGM", "BGN", "BGO", "BHD", "BIF", "BMD", "BND", "BOB", "BOL", "BOP", "BOV", "BRB", "BRC", "BRE", "BRL", "BRN", "BRR", "BRZ", "BSD", "BTN", "BUK", "BWP", "BYB", "BYN", "BYR", "BZD", "CAD", "CDF", "CHE", "CHF", "CHW", "CLE", "CLF", "CLP", "CNH", "CNX", "CNY", "COP", "COU", "CRC", "CSD", "CSK", "CUC", "CUP", "CVE", "CYP", "CZK", "DDM", "DEM", "DJF", "DKK", "DOP", "DZD", "ECS", "ECV", "EEK", "EGP", "ERN", "ESA", "ESB", "ESP", "ETB", "EUR", "FIM", "FJD", "FKP", "FRF", "GBP", "GEK", "GEL", "GHC", "GHS", "GIP", "GMD", "GNF", "GNS", "GQE", "GRD", "GTQ", "GWE", "GWP", "GYD", "HKD", "HNL", "HRD", "HRK", "HTG", "HUF", "IDR", "IEP", "ILP", "ILR", "ILS", "INR", "IQD", "IRR", "ISJ", "ISK", "ITL", "JMD", "JOD", "JPY", "KES", "KGS", "KHR", "KMF", "KPW", "KRH", "KRO", "KRW", "KWD", "KYD", "KZT", "LAK", "LBP", "LKR", "LRD", "LSL", "LTL", "LTT", "LUC", "LUF", "LUL", "LVL", "LVR", "LYD", "MAD", "MAF", "MCF", "MDC", "MDL", "MGA", "MGF", "MKD", "MKN", "MLF", "MMK", "MNT", "MOP", "MRO", "MTL", "MTP", "MUR", "MVP", "MVR", "MWK", "MXN", "MXP", "MXV", "MYR", "MZE", "MZM", "MZN", "NAD", "NGN", "NIC", "NIO", "NLG", "NOK", "NPR", "NZD", "OMR", "PAB", "PEI", "PEN", "PES", "PGK", "PHP", "PKR", "PLN", "PLZ", "PTE", "PYG", "QAR", "RHD", "ROL", "RON", "RSD", "RUB", "RUR", "RWF", "SAR", "SBD", "SCR", "SDD", "SDG", "SDP", "SEK", "SGD", "SHP", "SIT", "SKK", "SLL", "SOS", "SRD", "SRG", "SSP", "STD", "STN", "SUR", "SVC", "SYP", "SZL", "THB", "TJR", "TJS", "TMM", "TMT", "TND", "TOP", "TPE", "TRL", "TRY", "TTD", "TWD", "TZS", "UAH", "UAK", "UGS", "UGX", "USD", "USN", "USS", "UYI", "UYP", "UYU", "UZS", "VEB", "VEF", "VND", "VNN", "VUV", "WST", "XAF", "XAG", "XAU", "XBA", "XBB", "XBC", "XBD", "XCD", "XDR", "XEU", "XFO", "XFU", "XOF", "XPD", "XPF", "XPT", "XRE", "XSU", "XTS", "XUA", "XXX", "YDD", "YER", "YUD", "YUM", "YUN", "YUR", "ZAL", "ZAR", "ZMK", "ZMW", "ZRN", "ZRZ", "ZWD", "ZWL", "ZWR"},
+ currencyNegativePrefix: "(",
+ currencyNegativeSuffix: ")",
+ monthsAbbreviated: []string{"", "dzv", "dzd", "ted", "afɔ", "dam", "mas", "sia", "dea", "any", "kel", "ade", "dzm"},
+ monthsNarrow: []string{"", "d", "d", "t", "a", "d", "m", "s", "d", "a", "k", "a", "d"},
+ monthsWide: []string{"", "dzove", "dzodze", "tedoxe", "afɔfĩe", "dama", "masa", "siamlɔm", "deasiamime", "anyɔnyɔ", "kele", "adeɛmekpɔxe", "dzome"},
+ daysAbbreviated: []string{"kɔs", "dzo", "bla", "kuɖ", "yaw", "fiɖ", "mem"},
+ daysNarrow: []string{"k", "d", "b", "k", "y", "f", "m"},
+ daysShort: []string{"kɔs", "dzo", "bla", "kuɖ", "yaw", "fiɖ", "mem"},
+ daysWide: []string{"kɔsiɖa", "dzoɖa", "blaɖa", "kuɖa", "yawoɖa", "fiɖa", "memleɖa"},
+ periodsAbbreviated: []string{"ŋdi", "ɣetrɔ"},
+ periodsNarrow: []string{"ŋ", "ɣ"},
+ periodsWide: []string{"ŋdi", "ɣetrɔ"},
+ erasAbbreviated: []string{"HYV", "Yŋ"},
+ erasNarrow: []string{"hY", "Yŋ"},
+ erasWide: []string{"", ""},
+ timezones: map[string]string{"MDT": "Mountain kele gaƒoƒo me", "WAST": "West Africa dzomeŋɔli gaƒoƒo me", "LHST": "Lord Howe nutome gaƒoƒo me", "EAT": "East Africa gaƒoƒo me", "COT": "Colombia nutome gaƒoƒo me", "UYT": "Uruguay nutome gaƒoƒo me", "HECU": "Cuba kele gaƒoƒome", "AEST": "Australian Eastern nutome gaƒoƒo me", "HEOG": "West Greenland kele gaƒoƒo me", "HKST": "Hong Kong dzomeŋɔli gaƒoƒo me", "LHDT": "Lord Howe kele gaƒoƒo me", "SRT": "Suriname gaƒoƒome", "CLST": "Chile dzomeŋɔli gaƒoƒo me", "MST": "Mountain nutome gaƒoƒo me", "WART": "Ɣetoɖoƒe Argentina nutome gaƒoƒo me", "PDT": "Pacific kele gaƒoƒo me", "SAST": "South Africa nutome gaƒoƒo me", "WEZ": "Western Europe nutome gaƒoƒo me", "ACWDT": "Australian Central Western kele gaƒoƒo me", "HNEG": "East Greenland nutome gaƒoƒo me", "ChST": "Chamorro gaƒoƒo me", "HNCU": "Cuba nutome gaƒoƒome", "BOT": "Bolivia gaƒoƒo me", "ACST": "Australian Central nutome gaƒoƒo me", "OESZ": "Ɣedzeƒe Europe ŋkekeme gaƒoƒome", "CHADT": "Chatham kele gaƒoƒo me", "AEDT": "Australian Eastern kele gaƒoƒo me", "TMST": "Turkmenistan dzomeŋɔli gaƒoƒo me", "ART": "Argentina nutome gaƒoƒo me", "NZST": "New Zealand nutome gaƒoƒo me", "AKDT": "Alaska kele gaƒoƒo me", "HEPM": "St. Pierre & Miquelon kele gaƒoƒome", "HENOMX": "Northwest Mexico kele gaƒoƒo me", "TMT": "Turkmenistan nutome gaƒoƒo me", "HADT": "Hawaii-Aleutia kele gaƒoƒo me", "CDT": "Titina America kele gaƒoƒo me", "BT": "Bhutan gaƒoƒo me", "JDT": "Japan dzomeŋɔli gaƒoƒo me", "MEZ": "Central Europe nutome gaƒoƒo me", "WARST": "Ɣetoɖoƒe Argentina dzomeŋɔli gaƒoƒo me", "WIT": "Eastern Indonesia gaƒoƒo me", "OEZ": "Ɣedzeƒe Europe gaƒoƒoɖoanyime", "∅∅∅": "Eker dzomeŋɔli gaƒoƒome", "JST": "Japan nutome gaƒoƒo me", "ACWST": "Australian Central Western nutome gaƒoƒo me", "HEEG": "East Greenland dzomeŋɔli gaƒoƒo me", "GMT": "Greenwich gaƒoƒo me", "GYT": "Guyana gaƒoƒo me", "AKST": "Alaska nutome gaƒoƒo me", "MESZ": "Central Europe dzomeŋɔli gaƒoƒo me", "HNT": "Newfoundland nutome gaƒoƒome", "HNNOMX": "Northwest Mexico nutome gaƒoƒo me", "HAST": "Hawaii-Aleutia nutome gaƒoƒo me", "ARST": "Argentina dzomeŋɔli gaƒoƒo me", "CHAST": "Chatham nutome gaƒoƒo me", "HEPMX": "Mexican Pacific kele gaƒoƒome", "SGT": "Singapore nutome gaƒoƒo me", "CST": "Titina America nutome gaƒoƒo me", "HNOG": "West Greenland nutome gaƒoƒo me", "CAT": "Central Africa gaƒoƒo me", "AST": "Atlantic nutome gaƒoƒome", "WAT": "West Africa nutome gaƒoƒo me", "MYT": "Malaysia gaƒoƒo me", "GFT": "French Guiana gaƒoƒo me", "EDT": "Eastern America kele gaƒoƒo me", "ACDT": "Australian Central dzomeli gaƒoƒo me", "ADT": "Atlantic kele gaƒoƒome", "ECT": "Ecuador gaƒoƒo me", "HNPMX": "Mexican Pacific nutome gaƒoƒo me", "WESZ": "Western Europe dzomeŋɔli gaƒoƒo me", "EST": "Eastern America nutome gaƒoƒo me", "HAT": "Newfoundland kele gaƒoƒome", "VET": "Venezuela gaƒoƒo me", "HNPM": "St. Pierre & Miquelon nutome gaƒoƒome", "CLT": "Chile nutome gaƒoƒo me", "WIB": "Western Indonesia gaƒoƒo me", "NZDT": "New Zealand kele gaƒoƒo me", "HKT": "Hong Kong nutome gaƒoƒo me", "COST": "Colombia dzomeŋɔli gaƒoƒo me", "UYST": "Uruguay dzomeŋɔli gaƒoƒo me", "AWDT": "Australian Western kele gaƒoƒo me", "IST": "India gaƒoƒo me", "WITA": "Central Indonesia gaƒoƒo me", "PST": "Pacific nutome gaƒoƒo me", "AWST": "Australian Western nutome gaƒoƒo me"},
+ }
+}
+
+// Locale returns the current translators string locale
+func (ee *ee_GH) Locale() string {
+ return ee.locale
+}
+
+// PluralsCardinal returns the list of cardinal plural rules associated with 'ee_GH'
+func (ee *ee_GH) PluralsCardinal() []locales.PluralRule {
+ return ee.pluralsCardinal
+}
+
+// PluralsOrdinal returns the list of ordinal plural rules associated with 'ee_GH'
+func (ee *ee_GH) PluralsOrdinal() []locales.PluralRule {
+ return ee.pluralsOrdinal
+}
+
+// PluralsRange returns the list of range plural rules associated with 'ee_GH'
+func (ee *ee_GH) PluralsRange() []locales.PluralRule {
+ return ee.pluralsRange
+}
+
+// CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ee_GH'
+func (ee *ee_GH) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
+
+ n := math.Abs(num)
+
+ if n == 1 {
+ return locales.PluralRuleOne
+ }
+
+ return locales.PluralRuleOther
+}
+
+// OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ee_GH'
+func (ee *ee_GH) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ee_GH'
+func (ee *ee_GH) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
+ return locales.PluralRuleUnknown
+}
+
+// MonthAbbreviated returns the locales abbreviated month given the 'month' provided
+func (ee *ee_GH) MonthAbbreviated(month time.Month) string {
+ return ee.monthsAbbreviated[month]
+}
+
+// MonthsAbbreviated returns the locales abbreviated months
+func (ee *ee_GH) MonthsAbbreviated() []string {
+ return ee.monthsAbbreviated[1:]
+}
+
+// MonthNarrow returns the locales narrow month given the 'month' provided
+func (ee *ee_GH) MonthNarrow(month time.Month) string {
+ return ee.monthsNarrow[month]
+}
+
+// MonthsNarrow returns the locales narrow months
+func (ee *ee_GH) MonthsNarrow() []string {
+ return ee.monthsNarrow[1:]
+}
+
+// MonthWide returns the locales wide month given the 'month' provided
+func (ee *ee_GH) MonthWide(month time.Month) string {
+ return ee.monthsWide[month]
+}
+
+// MonthsWide returns the locales wide months
+func (ee *ee_GH) MonthsWide() []string {
+ return ee.monthsWide[1:]
+}
+
+// WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
+func (ee *ee_GH) WeekdayAbbreviated(weekday time.Weekday) string {
+ return ee.daysAbbreviated[weekday]
+}
+
+// WeekdaysAbbreviated returns the locales abbreviated weekdays
+func (ee *ee_GH) WeekdaysAbbreviated() []string {
+ return ee.daysAbbreviated
+}
+
+// WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
+func (ee *ee_GH) WeekdayNarrow(weekday time.Weekday) string {
+ return ee.daysNarrow[weekday]
+}
+
+// WeekdaysNarrow returns the locales narrow weekdays
+func (ee *ee_GH) WeekdaysNarrow() []string {
+ return ee.daysNarrow
+}
+
+// WeekdayShort returns the locales short weekday given the 'weekday' provided
+func (ee *ee_GH) WeekdayShort(weekday time.Weekday) string {
+ return ee.daysShort[weekday]
+}
+
+// WeekdaysShort returns the locales short weekdays
+func (ee *ee_GH) WeekdaysShort() []string {
+ return ee.daysShort
+}
+
+// WeekdayWide returns the locales wide weekday given the 'weekday' provided
+func (ee *ee_GH) WeekdayWide(weekday time.Weekday) string {
+ return ee.daysWide[weekday]
+}
+
+// WeekdaysWide returns the locales wide weekdays
+func (ee *ee_GH) WeekdaysWide() []string {
+ return ee.daysWide
+}
+
+// Decimal returns the decimal point of number
+func (ee *ee_GH) Decimal() string {
+ return ee.decimal
+}
+
+// Group returns the group of number
+func (ee *ee_GH) Group() string {
+ return ee.group
+}
+
+// Group returns the minus sign of number
+func (ee *ee_GH) Minus() string {
+ return ee.minus
+}
+
+// FmtNumber returns 'num' with digits/precision of 'v' for 'ee_GH' and handles both Whole and Real numbers based on 'v'
+func (ee *ee_GH) FmtNumber(num float64, v uint64) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ return string(b)
+}
+
+// FmtPercent returns 'num' with digits/precision of 'v' for 'ee_GH' and handles both Whole and Real numbers based on 'v'
+// NOTE: 'num' passed into FmtPercent is assumed to be in percent already
+func (ee *ee_GH) FmtPercent(num float64, v uint64) string {
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ l := len(s) + 3
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ continue
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ b = append(b, ee.percent...)
+
+ return string(b)
+}
+
+// FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ee_GH'
+func (ee *ee_GH) FmtCurrency(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ee.currencies[currency]
+ l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ if num < 0 {
+ b = append(b, ee.minus[0])
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ee.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ return string(b)
+}
+
+// FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ee_GH'
+// in accounting notation.
+func (ee *ee_GH) FmtAccounting(num float64, v uint64, currency currency.Type) string {
+
+ s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
+ symbol := ee.currencies[currency]
+ l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
+ count := 0
+ inWhole := v == 0
+ b := make([]byte, 0, l)
+
+ for i := len(s) - 1; i >= 0; i-- {
+
+ if s[i] == '.' {
+ b = append(b, ee.decimal[0])
+ inWhole = true
+ continue
+ }
+
+ if inWhole {
+ if count == 3 {
+ b = append(b, ee.group[0])
+ count = 1
+ } else {
+ count++
+ }
+ }
+
+ b = append(b, s[i])
+ }
+
+ if num < 0 {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ b = append(b, ee.currencyNegativePrefix[0])
+
+ } else {
+
+ for j := len(symbol) - 1; j >= 0; j-- {
+ b = append(b, symbol[j])
+ }
+
+ }
+
+ // reverse
+ for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
+ b[i], b[j] = b[j], b[i]
+ }
+
+ if int(v) < 2 {
+
+ if v == 0 {
+ b = append(b, ee.decimal...)
+ }
+
+ for i := 0; i < 2-int(v); i++ {
+ b = append(b, '0')
+ }
+ }
+
+ if num < 0 {
+ b = append(b, ee.currencyNegativeSuffix...)
+ }
+
+ return string(b)
+}
+
+// FmtDateShort returns the short date representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtDateShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = strconv.AppendInt(b, int64(t.Month()), 10)
+ b = append(b, []byte{0x2f}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x2f}...)
+
+ if t.Year() > 9 {
+ b = append(b, strconv.Itoa(t.Year())[2:]...)
+ } else {
+ b = append(b, strconv.Itoa(t.Year())[1:]...)
+ }
+
+ return string(b)
+}
+
+// FmtDateMedium returns the medium date representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtDateMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.monthsAbbreviated[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x2c, 0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateLong returns the long date representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtDateLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtDateFull returns the full date representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtDateFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ b = append(b, ee.daysWide[t.Weekday()]...)
+ b = append(b, []byte{0x2c, 0x20}...)
+ b = append(b, ee.monthsWide[t.Month()]...)
+ b = append(b, []byte{0x20}...)
+ b = strconv.AppendInt(b, int64(t.Day()), 10)
+ b = append(b, []byte{0x20, 0x6c, 0x69, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ if t.Year() > 0 {
+ b = strconv.AppendInt(b, int64(t.Year()), 10)
+ } else {
+ b = strconv.AppendInt(b, int64(-t.Year()), 10)
+ }
+
+ return string(b)
+}
+
+// FmtTimeShort returns the short time representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtTimeShort(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+
+ return string(b)
+}
+
+// FmtTimeMedium returns the medium time representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtTimeMedium(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+
+ return string(b)
+}
+
+// FmtTimeLong returns the long time representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtTimeLong(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+ b = append(b, tz...)
+
+ return string(b)
+}
+
+// FmtTimeFull returns the full time representation of 't' for 'ee_GH'
+func (ee *ee_GH) FmtTimeFull(t time.Time) string {
+
+ b := make([]byte, 0, 32)
+
+ if t.Hour() < 12 {
+ b = append(b, ee.periodsAbbreviated[0]...)
+ } else {
+ b = append(b, ee.periodsAbbreviated[1]...)
+ }
+
+ b = append(b, []byte{0x20, 0x67, 0x61}...)
+ b = append(b, []byte{0x20}...)
+
+ h := t.Hour()
+
+ if h > 12 {
+ h -= 12
+ }
+
+ b = strconv.AppendInt(b, int64(h), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Minute() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Minute()), 10)
+ b = append(b, ee.timeSeparator...)
+
+ if t.Second() < 10 {
+ b = append(b, '0')
+ }
+
+ b = strconv.AppendInt(b, int64(t.Second()), 10)
+ b = append(b, []byte{0x20}...)
+
+ tz, _ := t.Zone()
+
+ if btz, ok := ee.timezones[tz]; ok {
+ b = append(b, btz...)
+ } else {
+ b = append(b, tz...)
+ }
+
+ return string(b)
+}
diff --git a/vendor/github.com/go-playground/locales/ee_GH/ee_GH_test.go b/vendor/github.com/go-playground/locales/ee_GH/ee_GH_test.go
new file mode 100644
index 000000000..8ddba1bfd
--- /dev/null
+++ b/vendor/github.com/go-playground/locales/ee_GH/ee_GH_test.go
@@ -0,0 +1,1120 @@
+package ee_GH
+
+import (
+ "testing"
+ "time"
+
+ "github.com/go-playground/locales"
+ "github.com/go-playground/locales/currency"
+)
+
+func TestLocale(t *testing.T) {
+
+ trans := New()
+ expected := "ee_GH"
+
+ if trans.Locale() != expected {
+ t.Errorf("Expected '%s' Got '%s'", expected, trans.Locale())
+ }
+}
+
+func TestPluralsRange(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsRange()
+ // expected := 1
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsOrdinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsOrdinal()
+ // expected := 4
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestPluralsCardinal(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ expected locales.PluralRule
+ }{
+ // {
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ rules := trans.PluralsCardinal()
+ // expected := 2
+ // if len(rules) != expected {
+ // t.Errorf("Expected '%d' Got '%d'", expected, len(rules))
+ // }
+
+ for _, tt := range tests {
+
+ r := locales.PluralRuleUnknown
+
+ for i := 0; i < len(rules); i++ {
+ if rules[i] == tt.expected {
+ r = rules[i]
+ break
+ }
+ }
+ if r == locales.PluralRuleUnknown {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, r)
+ }
+ }
+}
+
+func TestRangePlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num1 float64
+ v1 uint64
+ num2 float64
+ v2 uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num1: 1,
+ // v1: 1,
+ // num2: 2,
+ // v2: 2,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.RangePluralRule(tt.num1, tt.v1, tt.num2, tt.v2)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestOrdinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 2,
+ // v: 0,
+ // expected: locales.PluralRuleTwo,
+ // },
+ // {
+ // num: 3,
+ // v: 0,
+ // expected: locales.PluralRuleFew,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.OrdinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestCardinalPlurals(t *testing.T) {
+
+ trans := New()
+
+ tests := []struct {
+ num float64
+ v uint64
+ expected locales.PluralRule
+ }{
+ // {
+ // num: 1,
+ // v: 0,
+ // expected: locales.PluralRuleOne,
+ // },
+ // {
+ // num: 4,
+ // v: 0,
+ // expected: locales.PluralRuleOther,
+ // },
+ }
+
+ for _, tt := range tests {
+ rule := trans.CardinalPluralRule(tt.num, tt.v)
+ if rule != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, rule)
+ }
+ }
+}
+
+func TestDaysAbbreviated(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysAbbreviated()
+
+ for i, day := range days {
+ s := trans.WeekdayAbbreviated(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sun",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mon",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tue",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wed",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thu",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fri",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sat",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayAbbreviated(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysNarrow(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysNarrow()
+
+ for i, day := range days {
+ s := trans.WeekdayNarrow(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", string(day), s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "S",
+ // },
+ // {
+ // idx: 1,
+ // expected: "M",
+ // },
+ // {
+ // idx: 2,
+ // expected: "T",
+ // },
+ // {
+ // idx: 3,
+ // expected: "W",
+ // },
+ // {
+ // idx: 4,
+ // expected: "T",
+ // },
+ // {
+ // idx: 5,
+ // expected: "F",
+ // },
+ // {
+ // idx: 6,
+ // expected: "S",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayNarrow(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysShort(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysShort()
+
+ for i, day := range days {
+ s := trans.WeekdayShort(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Su",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Mo",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tu",
+ // },
+ // {
+ // idx: 3,
+ // expected: "We",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Th",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Fr",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Sa",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayShort(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestDaysWide(t *testing.T) {
+
+ trans := New()
+ days := trans.WeekdaysWide()
+
+ for i, day := range days {
+ s := trans.WeekdayWide(time.Weekday(i))
+ if s != day {
+ t.Errorf("Expected '%s' Got '%s'", day, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 0,
+ // expected: "Sunday",
+ // },
+ // {
+ // idx: 1,
+ // expected: "Monday",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Tuesday",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Wednesday",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Thursday",
+ // },
+ // {
+ // idx: 5,
+ // expected: "Friday",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Saturday",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.WeekdayWide(time.Weekday(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsAbbreviated(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsAbbreviated()
+
+ for i, month := range months {
+ s := trans.MonthAbbreviated(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "Jan",
+ // },
+ // {
+ // idx: 2,
+ // expected: "Feb",
+ // },
+ // {
+ // idx: 3,
+ // expected: "Mar",
+ // },
+ // {
+ // idx: 4,
+ // expected: "Apr",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "Jun",
+ // },
+ // {
+ // idx: 7,
+ // expected: "Jul",
+ // },
+ // {
+ // idx: 8,
+ // expected: "Aug",
+ // },
+ // {
+ // idx: 9,
+ // expected: "Sep",
+ // },
+ // {
+ // idx: 10,
+ // expected: "Oct",
+ // },
+ // {
+ // idx: 11,
+ // expected: "Nov",
+ // },
+ // {
+ // idx: 12,
+ // expected: "Dec",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthAbbreviated(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsNarrow(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsNarrow()
+
+ for i, month := range months {
+ s := trans.MonthNarrow(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "J",
+ // },
+ // {
+ // idx: 2,
+ // expected: "F",
+ // },
+ // {
+ // idx: 3,
+ // expected: "M",
+ // },
+ // {
+ // idx: 4,
+ // expected: "A",
+ // },
+ // {
+ // idx: 5,
+ // expected: "M",
+ // },
+ // {
+ // idx: 6,
+ // expected: "J",
+ // },
+ // {
+ // idx: 7,
+ // expected: "J",
+ // },
+ // {
+ // idx: 8,
+ // expected: "A",
+ // },
+ // {
+ // idx: 9,
+ // expected: "S",
+ // },
+ // {
+ // idx: 10,
+ // expected: "O",
+ // },
+ // {
+ // idx: 11,
+ // expected: "N",
+ // },
+ // {
+ // idx: 12,
+ // expected: "D",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := trans.MonthNarrow(time.Month(tt.idx))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestMonthsWide(t *testing.T) {
+
+ trans := New()
+ months := trans.MonthsWide()
+
+ for i, month := range months {
+ s := trans.MonthWide(time.Month(i + 1))
+ if s != month {
+ t.Errorf("Expected '%s' Got '%s'", month, s)
+ }
+ }
+
+ tests := []struct {
+ idx int
+ expected string
+ }{
+ // {
+ // idx: 1,
+ // expected: "January",
+ // },
+ // {
+ // idx: 2,
+ // expected: "February",
+ // },
+ // {
+ // idx: 3,
+ // expected: "March",
+ // },
+ // {
+ // idx: 4,
+ // expected: "April",
+ // },
+ // {
+ // idx: 5,
+ // expected: "May",
+ // },
+ // {
+ // idx: 6,
+ // expected: "June",
+ // },
+ // {
+ // idx: 7,
+ // expected: "July",
+ // },
+ // {
+ // idx: 8,
+ // expected: "August",
+ // },
+ // {
+ // idx: 9,
+ // expected: "September",
+ // },
+ // {
+ // idx: 10,
+ // expected: "October",
+ // },
+ // {
+ // idx: 11,
+ // expected: "November",
+ // },
+ // {
+ // idx: 12,
+ // expected: "December",
+ // },
+ }
+
+ for _, tt := range tests {
+ s := string(trans.MonthWide(time.Month(tt.idx)))
+ if s != tt.expected {
+ t.Errorf("Expected '%s' Got '%s'", tt.expected, s)
+ }
+ }
+}
+
+func TestFmtTimeFull(t *testing.T) {
+
+ // loc, err := time.LoadLocation("America/Toronto")
+ // if err != nil {
+ // t.Errorf("Expected '