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 monthsAbbreviated []string
29 daysAbbreviated []string
33 periodsAbbreviated []string
34 periodsNarrow []string
37 erasAbbreviated []string
40 timezones map[string]string
43 // New returns a new instance of translator for the 'rn_BI' locale
44 func New() locales.Translator {
53 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", "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"},
55 monthsAbbreviated: []string{"", "Mut.", "Gas.", "Wer.", "Mat.", "Gic.", "Kam.", "Nya.", "Kan.", "Nze.", "Ukw.", "Ugu.", "Uku."},
56 monthsWide: []string{"", "Nzero", "Ruhuhuma", "Ntwarante", "Ndamukiza", "Rusama", "Ruheshi", "Mukakaro", "Nyandagaro", "Nyakanga", "Gitugutu", "Munyonyo", "Kigarama"},
57 daysAbbreviated: []string{"cu.", "mbe.", "kab.", "gtu.", "kan.", "gnu.", "gnd."},
58 daysWide: []string{"Ku w’indwi", "Ku wa mbere", "Ku wa kabiri", "Ku wa gatatu", "Ku wa kane", "Ku wa gatanu", "Ku wa gatandatu"},
59 periodsAbbreviated: []string{"Z.MU.", "Z.MW."},
60 periodsWide: []string{"Z.MU.", "Z.MW."},
61 erasAbbreviated: []string{"Mb.Y.", "Ny.Y"},
62 erasNarrow: []string{"", ""},
63 erasWide: []string{"Mbere ya Yezu", "Nyuma ya Yezu"},
64 timezones: map[string]string{"PDT": "PDT", "AWST": "AWST", "WAST": "WAST", "HNPMX": "HNPMX", "HNCU": "HNCU", "HNOG": "HNOG", "EAT": "EAT", "EDT": "EDT", "HEPMX": "HEPMX", "HEPM": "HEPM", "MST": "MST", "WARST": "WARST", "VET": "VET", "BT": "BT", "HAST": "HAST", "GYT": "GYT", "WART": "WART", "IST": "IST", "GFT": "GFT", "AEST": "AEST", "ARST": "ARST", "ChST": "ChST", "COT": "COT", "TMST": "TMST", "MYT": "MYT", "UYT": "UYT", "NZST": "NZST", "TMT": "TMT", "WITA": "WITA", "SGT": "SGT", "HECU": "HECU", "WESZ": "WESZ", "WIB": "WIB", "WIT": "WIT", "AEDT": "AEDT", "AST": "AST", "WAT": "WAT", "PST": "PST", "BOT": "BOT", "MEZ": "MEZ", "AKST": "AKST", "GMT": "GMT", "HNPM": "HNPM", "CHAST": "CHAST", "SRT": "SRT", "UYST": "UYST", "HNNOMX": "HNNOMX", "HKT": "HKT", "CLST": "CLST", "OESZ": "OESZ", "NZDT": "NZDT", "COST": "COST", "CAT": "CAT", "AWDT": "AWDT", "ACWDT": "ACWDT", "HADT": "HADT", "JST": "JST", "HEEG": "HEEG", "HKST": "HKST", "OEZ": "OEZ", "SAST": "SAST", "EST": "EST", "ACDT": "ACDT", "WEZ": "WEZ", "LHST": "LHST", "MDT": "MDT", "JDT": "JDT", "MESZ": "MESZ", "CST": "CST", "ACWST": "ACWST", "HEOG": "HEOG", "HNEG": "HNEG", "ACST": "ACST", "ECT": "ECT", "HENOMX": "HENOMX", "∅∅∅": "∅∅∅", "CLT": "CLT", "ART": "ART", "CHADT": "CHADT", "HAT": "HAT", "AKDT": "AKDT", "CDT": "CDT", "LHDT": "LHDT", "ADT": "ADT", "HNT": "HNT"},
68 // Locale returns the current translators string locale
69 func (rn *rn_BI) Locale() string {
73 // PluralsCardinal returns the list of cardinal plural rules associated with 'rn_BI'
74 func (rn *rn_BI) PluralsCardinal() []locales.PluralRule {
75 return rn.pluralsCardinal
78 // PluralsOrdinal returns the list of ordinal plural rules associated with 'rn_BI'
79 func (rn *rn_BI) PluralsOrdinal() []locales.PluralRule {
80 return rn.pluralsOrdinal
83 // PluralsRange returns the list of range plural rules associated with 'rn_BI'
84 func (rn *rn_BI) PluralsRange() []locales.PluralRule {
85 return rn.pluralsRange
88 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'rn_BI'
89 func (rn *rn_BI) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
90 return locales.PluralRuleUnknown
93 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'rn_BI'
94 func (rn *rn_BI) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
95 return locales.PluralRuleUnknown
98 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'rn_BI'
99 func (rn *rn_BI) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
100 return locales.PluralRuleUnknown
103 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
104 func (rn *rn_BI) MonthAbbreviated(month time.Month) string {
105 return rn.monthsAbbreviated[month]
108 // MonthsAbbreviated returns the locales abbreviated months
109 func (rn *rn_BI) MonthsAbbreviated() []string {
110 return rn.monthsAbbreviated[1:]
113 // MonthNarrow returns the locales narrow month given the 'month' provided
114 func (rn *rn_BI) MonthNarrow(month time.Month) string {
115 return rn.monthsNarrow[month]
118 // MonthsNarrow returns the locales narrow months
119 func (rn *rn_BI) MonthsNarrow() []string {
123 // MonthWide returns the locales wide month given the 'month' provided
124 func (rn *rn_BI) MonthWide(month time.Month) string {
125 return rn.monthsWide[month]
128 // MonthsWide returns the locales wide months
129 func (rn *rn_BI) MonthsWide() []string {
130 return rn.monthsWide[1:]
133 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
134 func (rn *rn_BI) WeekdayAbbreviated(weekday time.Weekday) string {
135 return rn.daysAbbreviated[weekday]
138 // WeekdaysAbbreviated returns the locales abbreviated weekdays
139 func (rn *rn_BI) WeekdaysAbbreviated() []string {
140 return rn.daysAbbreviated
143 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
144 func (rn *rn_BI) WeekdayNarrow(weekday time.Weekday) string {
145 return rn.daysNarrow[weekday]
148 // WeekdaysNarrow returns the locales narrow weekdays
149 func (rn *rn_BI) WeekdaysNarrow() []string {
153 // WeekdayShort returns the locales short weekday given the 'weekday' provided
154 func (rn *rn_BI) WeekdayShort(weekday time.Weekday) string {
155 return rn.daysShort[weekday]
158 // WeekdaysShort returns the locales short weekdays
159 func (rn *rn_BI) WeekdaysShort() []string {
163 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
164 func (rn *rn_BI) WeekdayWide(weekday time.Weekday) string {
165 return rn.daysWide[weekday]
168 // WeekdaysWide returns the locales wide weekdays
169 func (rn *rn_BI) WeekdaysWide() []string {
173 // Decimal returns the decimal point of number
174 func (rn *rn_BI) Decimal() string {
178 // Group returns the group of number
179 func (rn *rn_BI) Group() string {
183 // Group returns the minus sign of number
184 func (rn *rn_BI) Minus() string {
188 // FmtNumber returns 'num' with digits/precision of 'v' for 'rn_BI' and handles both Whole and Real numbers based on 'v'
189 func (rn *rn_BI) FmtNumber(num float64, v uint64) string {
191 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
192 l := len(s) + 1 + 1*len(s[:len(s)-int(v)-1])/3
195 b := make([]byte, 0, l)
197 for i := len(s) - 1; i >= 0; i-- {
200 b = append(b, rn.decimal[0])
207 b = append(b, rn.group[0])
218 b = append(b, rn.minus[0])
222 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
223 b[i], b[j] = b[j], b[i]
229 // FmtPercent returns 'num' with digits/precision of 'v' for 'rn_BI' and handles both Whole and Real numbers based on 'v'
230 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
231 func (rn *rn_BI) FmtPercent(num float64, v uint64) string {
232 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
234 b := make([]byte, 0, l)
236 for i := len(s) - 1; i >= 0; i-- {
239 b = append(b, rn.decimal[0])
247 b = append(b, rn.minus[0])
251 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
252 b[i], b[j] = b[j], b[i]
255 b = append(b, rn.percentSuffix...)
257 b = append(b, rn.percent...)
262 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'rn_BI'
263 func (rn *rn_BI) FmtCurrency(num float64, v uint64, currency currency.Type) string {
265 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
266 symbol := rn.currencies[currency]
267 l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
270 b := make([]byte, 0, l)
272 for i := len(s) - 1; i >= 0; i-- {
275 b = append(b, rn.decimal[0])
282 b = append(b, rn.group[0])
293 b = append(b, rn.minus[0])
297 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
298 b[i], b[j] = b[j], b[i]
304 b = append(b, rn.decimal...)
307 for i := 0; i < 2-int(v); i++ {
312 b = append(b, symbol...)
317 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'rn_BI'
318 // in accounting notation.
319 func (rn *rn_BI) FmtAccounting(num float64, v uint64, currency currency.Type) string {
321 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
322 symbol := rn.currencies[currency]
323 l := len(s) + len(symbol) + 1 + 1*len(s[:len(s)-int(v)-1])/3
326 b := make([]byte, 0, l)
328 for i := len(s) - 1; i >= 0; i-- {
331 b = append(b, rn.decimal[0])
338 b = append(b, rn.group[0])
350 b = append(b, rn.minus[0])
355 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
356 b[i], b[j] = b[j], b[i]
362 b = append(b, rn.decimal...)
365 for i := 0; i < 2-int(v); i++ {
371 b = append(b, symbol...)
374 b = append(b, symbol...)
380 // FmtDateShort returns the short date representation of 't' for 'rn_BI'
381 func (rn *rn_BI) FmtDateShort(t time.Time) string {
383 b := make([]byte, 0, 32)
385 b = strconv.AppendInt(b, int64(t.Day()), 10)
386 b = append(b, []byte{0x2f}...)
387 b = strconv.AppendInt(b, int64(t.Month()), 10)
388 b = append(b, []byte{0x2f}...)
391 b = strconv.AppendInt(b, int64(t.Year()), 10)
393 b = strconv.AppendInt(b, int64(-t.Year()), 10)
399 // FmtDateMedium returns the medium date representation of 't' for 'rn_BI'
400 func (rn *rn_BI) FmtDateMedium(t time.Time) string {
402 b := make([]byte, 0, 32)
404 b = strconv.AppendInt(b, int64(t.Day()), 10)
405 b = append(b, []byte{0x20}...)
406 b = append(b, rn.monthsAbbreviated[t.Month()]...)
407 b = append(b, []byte{0x20}...)
410 b = strconv.AppendInt(b, int64(t.Year()), 10)
412 b = strconv.AppendInt(b, int64(-t.Year()), 10)
418 // FmtDateLong returns the long date representation of 't' for 'rn_BI'
419 func (rn *rn_BI) FmtDateLong(t time.Time) string {
421 b := make([]byte, 0, 32)
423 b = strconv.AppendInt(b, int64(t.Day()), 10)
424 b = append(b, []byte{0x20}...)
425 b = append(b, rn.monthsWide[t.Month()]...)
426 b = append(b, []byte{0x20}...)
429 b = strconv.AppendInt(b, int64(t.Year()), 10)
431 b = strconv.AppendInt(b, int64(-t.Year()), 10)
437 // FmtDateFull returns the full date representation of 't' for 'rn_BI'
438 func (rn *rn_BI) FmtDateFull(t time.Time) string {
440 b := make([]byte, 0, 32)
442 b = append(b, rn.daysWide[t.Weekday()]...)
443 b = append(b, []byte{0x20}...)
444 b = strconv.AppendInt(b, int64(t.Day()), 10)
445 b = append(b, []byte{0x20}...)
446 b = append(b, rn.monthsWide[t.Month()]...)
447 b = append(b, []byte{0x20}...)
450 b = strconv.AppendInt(b, int64(t.Year()), 10)
452 b = strconv.AppendInt(b, int64(-t.Year()), 10)
458 // FmtTimeShort returns the short time representation of 't' for 'rn_BI'
459 func (rn *rn_BI) FmtTimeShort(t time.Time) string {
461 b := make([]byte, 0, 32)
467 b = strconv.AppendInt(b, int64(t.Hour()), 10)
468 b = append(b, rn.timeSeparator...)
474 b = strconv.AppendInt(b, int64(t.Minute()), 10)
479 // FmtTimeMedium returns the medium time representation of 't' for 'rn_BI'
480 func (rn *rn_BI) FmtTimeMedium(t time.Time) string {
482 b := make([]byte, 0, 32)
488 b = strconv.AppendInt(b, int64(t.Hour()), 10)
489 b = append(b, rn.timeSeparator...)
495 b = strconv.AppendInt(b, int64(t.Minute()), 10)
496 b = append(b, rn.timeSeparator...)
502 b = strconv.AppendInt(b, int64(t.Second()), 10)
507 // FmtTimeLong returns the long time representation of 't' for 'rn_BI'
508 func (rn *rn_BI) FmtTimeLong(t time.Time) string {
510 b := make([]byte, 0, 32)
516 b = strconv.AppendInt(b, int64(t.Hour()), 10)
517 b = append(b, rn.timeSeparator...)
523 b = strconv.AppendInt(b, int64(t.Minute()), 10)
524 b = append(b, rn.timeSeparator...)
530 b = strconv.AppendInt(b, int64(t.Second()), 10)
531 b = append(b, []byte{0x20}...)
539 // FmtTimeFull returns the full time representation of 't' for 'rn_BI'
540 func (rn *rn_BI) FmtTimeFull(t time.Time) string {
542 b := make([]byte, 0, 32)
548 b = strconv.AppendInt(b, int64(t.Hour()), 10)
549 b = append(b, rn.timeSeparator...)
555 b = strconv.AppendInt(b, int64(t.Minute()), 10)
556 b = append(b, rn.timeSeparator...)
562 b = strconv.AppendInt(b, int64(t.Second()), 10)
563 b = append(b, []byte{0x20}...)
567 if btz, ok := rn.timezones[tz]; ok {
568 b = append(b, btz...)