8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
25 currencies []string // idx = enum of currency code
26 currencyPositiveSuffix string
27 currencyNegativeSuffix string
28 monthsAbbreviated []string
31 daysAbbreviated []string
35 periodsAbbreviated []string
36 periodsNarrow []string
39 erasAbbreviated []string
42 timezones map[string]string
45 // New returns a new instance of translator for the 'nl_BQ' locale
46 func New() locales.Translator {
49 pluralsCardinal: []locales.PluralRule{2, 6},
50 pluralsOrdinal: []locales.PluralRule{6},
51 pluralsRange: []locales.PluralRule{2, 6},
59 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", "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", "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", "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"},
61 currencyPositiveSuffix: " ",
62 currencyNegativeSuffix: " ",
63 monthsAbbreviated: []string{"", "jan.", "feb.", "mrt.", "apr.", "mei", "jun.", "jul.", "aug.", "sep.", "okt.", "nov.", "dec."},
64 monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
65 monthsWide: []string{"", "januari", "februari", "maart", "april", "mei", "juni", "juli", "augustus", "september", "oktober", "november", "december"},
66 daysAbbreviated: []string{"zo", "ma", "di", "wo", "do", "vr", "za"},
67 daysNarrow: []string{"Z", "M", "D", "W", "D", "V", "Z"},
68 daysShort: []string{"zo", "ma", "di", "wo", "do", "vr", "za"},
69 daysWide: []string{"zondag", "maandag", "dinsdag", "woensdag", "donderdag", "vrijdag", "zaterdag"},
70 periodsAbbreviated: []string{"a.m.", "p.m."},
71 periodsNarrow: []string{"a.m.", "p.m."},
72 periodsWide: []string{"a.m.", "p.m."},
73 erasAbbreviated: []string{"v.Chr.", "n.Chr."},
74 erasNarrow: []string{"v.C.", "n.C."},
75 erasWide: []string{"voor Christus", "na Christus"},
76 timezones: map[string]string{"WAST": "West-Afrikaanse zomertijd", "HNT": "Newfoundland-standaardtijd", "WIB": "West-Indonesische tijd", "CHAST": "Chatham-standaardtijd", "MESZ": "Midden-Europese zomertijd", "HADT": "Hawaii-Aleoetische zomertijd", "NZST": "Nieuw-Zeelandse standaardtijd", "JDT": "Japanse zomertijd", "HKST": "Hongkongse zomertijd", "CDT": "Central-zomertijd", "MDT": "Macause zomertijd", "OESZ": "Oost-Europese zomertijd", "HNEG": "Oost-Groenlandse standaardtijd", "CLT": "Chileense standaardtijd", "GYT": "Guyaanse tijd", "HNPM": "Saint Pierre en Miquelon-standaardtijd", "SRT": "Surinaamse tijd", "ACWDT": "Midden-Australische westelijke zomertijd", "WARST": "West-Argentijnse zomertijd", "ADT": "Atlantic-zomertijd", "AWDT": "West-Australische zomertijd", "HNNOMX": "Noordwest-Mexicaanse standaardtijd", "COT": "Colombiaanse standaardtijd", "CAT": "Centraal-Afrikaanse tijd", "WAT": "West-Afrikaanse standaardtijd", "CHADT": "Chatham-zomertijd", "UYT": "Uruguayaanse standaardtijd", "UYST": "Uruguayaanse zomertijd", "HAST": "Hawaii-Aleoetische standaardtijd", "WITA": "Centraal-Indonesische tijd", "HNOG": "West-Groenlandse standaardtijd", "VET": "Venezolaanse tijd", "ART": "Argentijnse standaardtijd", "EST": "Eastern-standaardtijd", "ECT": "Ecuadoraanse tijd", "EDT": "Eastern-zomertijd", "∅∅∅": "Peruaanse zomertijd", "GMT": "Greenwich Mean Time", "HECU": "Cubaanse zomertijd", "HEPM": "Saint Pierre en Miquelon-zomertijd", "TMT": "Turkmeense standaardtijd", "CLST": "Chileense zomertijd", "ACST": "Midden-Australische standaardtijd", "SGT": "Singaporese standaardtijd", "MEZ": "Midden-Europese standaardtijd", "NZDT": "Nieuw-Zeelandse zomertijd", "OEZ": "Oost-Europese standaardtijd", "WART": "West-Argentijnse standaardtijd", "SAST": "Zuid-Afrikaanse tijd", "COST": "Colombiaanse zomertijd", "HNCU": "Cubaanse standaardtijd", "CST": "Central-standaardtijd", "MST": "Macause standaardtijd", "JST": "Japanse standaardtijd", "IST": "Indiase tijd", "AKST": "Alaska-standaardtijd", "BT": "Bhutaanse tijd", "AWST": "West-Australische standaardtijd", "TMST": "Turkmeense zomertijd", "LHDT": "Lord Howe-eilandse zomertijd", "ARST": "Argentijnse zomertijd", "GFT": "Frans-Guyaanse tijd", "PST": "Pacific-standaardtijd", "HENOMX": "Noordwest-Mexicaanse zomertijd", "HEEG": "Oost-Groenlandse zomertijd", "WEZ": "West-Europese standaardtijd", "WESZ": "West-Europese zomertijd", "ChST": "Chamorro-tijd", "ACWST": "Midden-Australische westelijke standaardtijd", "MYT": "Maleisische tijd", "AEST": "Oost-Australische standaardtijd", "AEDT": "Oost-Australische zomertijd", "EAT": "Oost-Afrikaanse tijd", "WIT": "Oost-Indonesische tijd", "LHST": "Lord Howe-eilandse standaardtijd", "HKT": "Hongkongse standaardtijd", "AKDT": "Alaska-zomertijd", "ACDT": "Midden-Australische zomertijd", "HNPMX": "Mexicaanse Pacific-standaardtijd", "HEPMX": "Mexicaanse Pacific-zomertijd", "PDT": "Pacific-zomertijd", "AST": "Atlantic-standaardtijd", "HEOG": "West-Groenlandse zomertijd", "HAT": "Newfoundland-zomertijd", "BOT": "Boliviaanse tijd"},
80 // Locale returns the current translators string locale
81 func (nl *nl_BQ) Locale() string {
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'nl_BQ'
86 func (nl *nl_BQ) PluralsCardinal() []locales.PluralRule {
87 return nl.pluralsCardinal
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'nl_BQ'
91 func (nl *nl_BQ) PluralsOrdinal() []locales.PluralRule {
92 return nl.pluralsOrdinal
95 // PluralsRange returns the list of range plural rules associated with 'nl_BQ'
96 func (nl *nl_BQ) PluralsRange() []locales.PluralRule {
97 return nl.pluralsRange
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'nl_BQ'
101 func (nl *nl_BQ) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
106 if i == 1 && v == 0 {
107 return locales.PluralRuleOne
110 return locales.PluralRuleOther
113 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'nl_BQ'
114 func (nl *nl_BQ) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
115 return locales.PluralRuleOther
118 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'nl_BQ'
119 func (nl *nl_BQ) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
121 start := nl.CardinalPluralRule(num1, v1)
122 end := nl.CardinalPluralRule(num2, v2)
124 if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
125 return locales.PluralRuleOther
126 } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
127 return locales.PluralRuleOne
130 return locales.PluralRuleOther
134 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
135 func (nl *nl_BQ) MonthAbbreviated(month time.Month) string {
136 return nl.monthsAbbreviated[month]
139 // MonthsAbbreviated returns the locales abbreviated months
140 func (nl *nl_BQ) MonthsAbbreviated() []string {
141 return nl.monthsAbbreviated[1:]
144 // MonthNarrow returns the locales narrow month given the 'month' provided
145 func (nl *nl_BQ) MonthNarrow(month time.Month) string {
146 return nl.monthsNarrow[month]
149 // MonthsNarrow returns the locales narrow months
150 func (nl *nl_BQ) MonthsNarrow() []string {
151 return nl.monthsNarrow[1:]
154 // MonthWide returns the locales wide month given the 'month' provided
155 func (nl *nl_BQ) MonthWide(month time.Month) string {
156 return nl.monthsWide[month]
159 // MonthsWide returns the locales wide months
160 func (nl *nl_BQ) MonthsWide() []string {
161 return nl.monthsWide[1:]
164 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
165 func (nl *nl_BQ) WeekdayAbbreviated(weekday time.Weekday) string {
166 return nl.daysAbbreviated[weekday]
169 // WeekdaysAbbreviated returns the locales abbreviated weekdays
170 func (nl *nl_BQ) WeekdaysAbbreviated() []string {
171 return nl.daysAbbreviated
174 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
175 func (nl *nl_BQ) WeekdayNarrow(weekday time.Weekday) string {
176 return nl.daysNarrow[weekday]
179 // WeekdaysNarrow returns the locales narrow weekdays
180 func (nl *nl_BQ) WeekdaysNarrow() []string {
184 // WeekdayShort returns the locales short weekday given the 'weekday' provided
185 func (nl *nl_BQ) WeekdayShort(weekday time.Weekday) string {
186 return nl.daysShort[weekday]
189 // WeekdaysShort returns the locales short weekdays
190 func (nl *nl_BQ) WeekdaysShort() []string {
194 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
195 func (nl *nl_BQ) WeekdayWide(weekday time.Weekday) string {
196 return nl.daysWide[weekday]
199 // WeekdaysWide returns the locales wide weekdays
200 func (nl *nl_BQ) WeekdaysWide() []string {
204 // Decimal returns the decimal point of number
205 func (nl *nl_BQ) Decimal() string {
209 // Group returns the group of number
210 func (nl *nl_BQ) Group() string {
214 // Group returns the minus sign of number
215 func (nl *nl_BQ) Minus() string {
219 // FmtNumber returns 'num' with digits/precision of 'v' for 'nl_BQ' and handles both Whole and Real numbers based on 'v'
220 func (nl *nl_BQ) FmtNumber(num float64, v uint64) string {
222 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
223 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
226 b := make([]byte, 0, l)
228 for i := len(s) - 1; i >= 0; i-- {
231 b = append(b, nl.decimal[0])
238 b = append(b, nl.group[0])
249 b = append(b, nl.minus[0])
253 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
254 b[i], b[j] = b[j], b[i]
260 // FmtPercent returns 'num' with digits/precision of 'v' for 'nl_BQ' and handles both Whole and Real numbers based on 'v'
261 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
262 func (nl *nl_BQ) FmtPercent(num float64, v uint64) string {
263 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
265 b := make([]byte, 0, l)
267 for i := len(s) - 1; i >= 0; i-- {
270 b = append(b, nl.decimal[0])
278 b = append(b, nl.minus[0])
282 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
283 b[i], b[j] = b[j], b[i]
286 b = append(b, nl.percentSuffix...)
288 b = append(b, nl.percent...)
293 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'nl_BQ'
294 func (nl *nl_BQ) FmtCurrency(num float64, v uint64, currency currency.Type) string {
296 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
297 symbol := nl.currencies[currency]
298 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
301 b := make([]byte, 0, l)
303 for i := len(s) - 1; i >= 0; i-- {
306 b = append(b, nl.decimal[0])
313 b = append(b, nl.group[0])
324 b = append(b, nl.minus[0])
328 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
329 b[i], b[j] = b[j], b[i]
335 b = append(b, nl.decimal...)
338 for i := 0; i < 2-int(v); i++ {
343 b = append(b, nl.currencyPositiveSuffix...)
345 b = append(b, symbol...)
350 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'nl_BQ'
351 // in accounting notation.
352 func (nl *nl_BQ) FmtAccounting(num float64, v uint64, currency currency.Type) string {
354 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
355 symbol := nl.currencies[currency]
356 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
359 b := make([]byte, 0, l)
361 for i := len(s) - 1; i >= 0; i-- {
364 b = append(b, nl.decimal[0])
371 b = append(b, nl.group[0])
383 b = append(b, nl.minus[0])
388 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
389 b[i], b[j] = b[j], b[i]
395 b = append(b, nl.decimal...)
398 for i := 0; i < 2-int(v); i++ {
404 b = append(b, nl.currencyNegativeSuffix...)
405 b = append(b, symbol...)
408 b = append(b, nl.currencyPositiveSuffix...)
409 b = append(b, symbol...)
415 // FmtDateShort returns the short date representation of 't' for 'nl_BQ'
416 func (nl *nl_BQ) FmtDateShort(t time.Time) string {
418 b := make([]byte, 0, 32)
424 b = strconv.AppendInt(b, int64(t.Day()), 10)
425 b = append(b, []byte{0x2d}...)
431 b = strconv.AppendInt(b, int64(t.Month()), 10)
433 b = append(b, []byte{0x2d}...)
436 b = append(b, strconv.Itoa(t.Year())[2:]...)
438 b = append(b, strconv.Itoa(t.Year())[1:]...)
444 // FmtDateMedium returns the medium date representation of 't' for 'nl_BQ'
445 func (nl *nl_BQ) FmtDateMedium(t time.Time) string {
447 b := make([]byte, 0, 32)
449 b = strconv.AppendInt(b, int64(t.Day()), 10)
450 b = append(b, []byte{0x20}...)
451 b = append(b, nl.monthsAbbreviated[t.Month()]...)
452 b = append(b, []byte{0x20}...)
455 b = strconv.AppendInt(b, int64(t.Year()), 10)
457 b = strconv.AppendInt(b, int64(-t.Year()), 10)
463 // FmtDateLong returns the long date representation of 't' for 'nl_BQ'
464 func (nl *nl_BQ) FmtDateLong(t time.Time) string {
466 b := make([]byte, 0, 32)
468 b = strconv.AppendInt(b, int64(t.Day()), 10)
469 b = append(b, []byte{0x20}...)
470 b = append(b, nl.monthsWide[t.Month()]...)
471 b = append(b, []byte{0x20}...)
474 b = strconv.AppendInt(b, int64(t.Year()), 10)
476 b = strconv.AppendInt(b, int64(-t.Year()), 10)
482 // FmtDateFull returns the full date representation of 't' for 'nl_BQ'
483 func (nl *nl_BQ) FmtDateFull(t time.Time) string {
485 b := make([]byte, 0, 32)
487 b = append(b, nl.daysWide[t.Weekday()]...)
488 b = append(b, []byte{0x20}...)
489 b = strconv.AppendInt(b, int64(t.Day()), 10)
490 b = append(b, []byte{0x20}...)
491 b = append(b, nl.monthsWide[t.Month()]...)
492 b = append(b, []byte{0x20}...)
495 b = strconv.AppendInt(b, int64(t.Year()), 10)
497 b = strconv.AppendInt(b, int64(-t.Year()), 10)
503 // FmtTimeShort returns the short time representation of 't' for 'nl_BQ'
504 func (nl *nl_BQ) FmtTimeShort(t time.Time) string {
506 b := make([]byte, 0, 32)
512 b = strconv.AppendInt(b, int64(t.Hour()), 10)
513 b = append(b, nl.timeSeparator...)
519 b = strconv.AppendInt(b, int64(t.Minute()), 10)
524 // FmtTimeMedium returns the medium time representation of 't' for 'nl_BQ'
525 func (nl *nl_BQ) FmtTimeMedium(t time.Time) string {
527 b := make([]byte, 0, 32)
533 b = strconv.AppendInt(b, int64(t.Hour()), 10)
534 b = append(b, nl.timeSeparator...)
540 b = strconv.AppendInt(b, int64(t.Minute()), 10)
541 b = append(b, nl.timeSeparator...)
547 b = strconv.AppendInt(b, int64(t.Second()), 10)
552 // FmtTimeLong returns the long time representation of 't' for 'nl_BQ'
553 func (nl *nl_BQ) FmtTimeLong(t time.Time) string {
555 b := make([]byte, 0, 32)
561 b = strconv.AppendInt(b, int64(t.Hour()), 10)
562 b = append(b, nl.timeSeparator...)
568 b = strconv.AppendInt(b, int64(t.Minute()), 10)
569 b = append(b, nl.timeSeparator...)
575 b = strconv.AppendInt(b, int64(t.Second()), 10)
576 b = append(b, []byte{0x20}...)
584 // FmtTimeFull returns the full time representation of 't' for 'nl_BQ'
585 func (nl *nl_BQ) FmtTimeFull(t time.Time) string {
587 b := make([]byte, 0, 32)
593 b = strconv.AppendInt(b, int64(t.Hour()), 10)
594 b = append(b, nl.timeSeparator...)
600 b = strconv.AppendInt(b, int64(t.Minute()), 10)
601 b = append(b, nl.timeSeparator...)
607 b = strconv.AppendInt(b, int64(t.Second()), 10)
608 b = append(b, []byte{0x20}...)
612 if btz, ok := nl.timezones[tz]; ok {
613 b = append(b, btz...)