1 package ff_Latn_BF
2
3 import (
4 "math"
5 "strconv"
6 "time"
7
8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
10 )
11
12 type ff_Latn_BF struct {
13 locale string
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
17 decimal string
18 group string
19 minus string
20 percent string
21 perMille string
22 timeSeparator string
23 inifinity string
24 currencies []string
25 currencyPositiveSuffix string
26 currencyNegativeSuffix string
27 monthsAbbreviated []string
28 monthsNarrow []string
29 monthsWide []string
30 daysAbbreviated []string
31 daysNarrow []string
32 daysShort []string
33 daysWide []string
34 periodsAbbreviated []string
35 periodsNarrow []string
36 periodsShort []string
37 periodsWide []string
38 erasAbbreviated []string
39 erasNarrow []string
40 erasWide []string
41 timezones map[string]string
42 }
43
44
45 func New() locales.Translator {
46 return &ff_Latn_BF{
47 locale: "ff_Latn_BF",
48 pluralsCardinal: []locales.PluralRule{2, 6},
49 pluralsOrdinal: nil,
50 pluralsRange: nil,
51 decimal: ",",
52 group: " ",
53 timeSeparator: ":",
54 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", "MRU", "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", "UYW", "UZS", "VEB", "VEF", "VES", "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 currencyPositiveSuffix: " ",
56 currencyNegativeSuffix: " ",
57 monthsAbbreviated: []string{"", "sii", "col", "mbo", "see", "duu", "kor", "mor", "juk", "slt", "yar", "jol", "bow"},
58 monthsNarrow: []string{"", "s", "c", "m", "s", "d", "k", "m", "j", "s", "y", "j", "b"},
59 monthsWide: []string{"", "siilo", "colte", "mbooy", "seeɗto", "duujal", "korse", "morso", "juko", "siilto", "yarkomaa", "jolal", "bowte"},
60 daysAbbreviated: []string{"dew", "aaɓ", "maw", "nje", "naa", "mwd", "hbi"},
61 daysNarrow: []string{"d", "a", "m", "n", "n", "m", "h"},
62 daysWide: []string{"dewo", "aaɓnde", "mawbaare", "njeslaare", "naasaande", "mawnde", "hoore-biir"},
63 periodsAbbreviated: []string{"subaka", "kikiiɗe"},
64 periodsWide: []string{"subaka", "kikiiɗe"},
65 erasAbbreviated: []string{"H-I", "C-I"},
66 erasNarrow: []string{"", ""},
67 erasWide: []string{"Hade Iisa", "Caggal Iisa"},
68 timezones: map[string]string{"ACDT": "ACDT", "ACST": "ACST", "ACWDT": "ACWDT", "ACWST": "ACWST", "ADT": "ADT", "AEDT": "AEDT", "AEST": "AEST", "AKDT": "AKDT", "AKST": "AKST", "ARST": "ARST", "ART": "ART", "AST": "AST", "AWDT": "AWDT", "AWST": "AWST", "BOT": "BOT", "BT": "BT", "CAT": "CAT", "CDT": "CDT", "CHADT": "CHADT", "CHAST": "CHAST", "CLST": "CLST", "CLT": "CLT", "COST": "COST", "COT": "COT", "CST": "CST", "ChST": "ChST", "EAT": "EAT", "ECT": "ECT", "EDT": "EDT", "EST": "EST", "GFT": "GFT", "GMT": "GMT", "GST": "GST", "GYT": "GYT", "HADT": "HADT", "HAST": "HAST", "HAT": "HAT", "HECU": "HECU", "HEEG": "HEEG", "HENOMX": "HENOMX", "HEOG": "HEOG", "HEPM": "HEPM", "HEPMX": "HEPMX", "HKST": "HKST", "HKT": "HKT", "HNCU": "HNCU", "HNEG": "HNEG", "HNNOMX": "HNNOMX", "HNOG": "HNOG", "HNPM": "HNPM", "HNPMX": "HNPMX", "HNT": "HNT", "IST": "IST", "JDT": "JDT", "JST": "JST", "LHDT": "LHDT", "LHST": "LHST", "MDT": "MDT", "MESZ": "MESZ", "MEZ": "MEZ", "MST": "MST", "MYT": "MYT", "NZDT": "NZDT", "NZST": "NZST", "OESZ": "OESZ", "OEZ": "OEZ", "PDT": "PDT", "PST": "PST", "SAST": "SAST", "SGT": "SGT", "SRT": "SRT", "TMST": "TMST", "TMT": "TMT", "UYST": "UYST", "UYT": "UYT", "VET": "VET", "WARST": "WARST", "WART": "WART", "WAST": "WAST", "WAT": "WAT", "WESZ": "WESZ", "WEZ": "WEZ", "WIB": "WIB", "WIT": "WIT", "WITA": "WITA", "∅∅∅": "∅∅∅"},
69 }
70 }
71
72
73 func (ff *ff_Latn_BF) Locale() string {
74 return ff.locale
75 }
76
77
78 func (ff *ff_Latn_BF) PluralsCardinal() []locales.PluralRule {
79 return ff.pluralsCardinal
80 }
81
82
83 func (ff *ff_Latn_BF) PluralsOrdinal() []locales.PluralRule {
84 return ff.pluralsOrdinal
85 }
86
87
88 func (ff *ff_Latn_BF) PluralsRange() []locales.PluralRule {
89 return ff.pluralsRange
90 }
91
92
93 func (ff *ff_Latn_BF) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
94
95 n := math.Abs(num)
96 i := int64(n)
97
98 if i == 0 || i == 1 {
99 return locales.PluralRuleOne
100 }
101
102 return locales.PluralRuleOther
103 }
104
105
106 func (ff *ff_Latn_BF) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
107 return locales.PluralRuleUnknown
108 }
109
110
111 func (ff *ff_Latn_BF) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
112 return locales.PluralRuleUnknown
113 }
114
115
116 func (ff *ff_Latn_BF) MonthAbbreviated(month time.Month) string {
117 return ff.monthsAbbreviated[month]
118 }
119
120
121 func (ff *ff_Latn_BF) MonthsAbbreviated() []string {
122 return ff.monthsAbbreviated[1:]
123 }
124
125
126 func (ff *ff_Latn_BF) MonthNarrow(month time.Month) string {
127 return ff.monthsNarrow[month]
128 }
129
130
131 func (ff *ff_Latn_BF) MonthsNarrow() []string {
132 return ff.monthsNarrow[1:]
133 }
134
135
136 func (ff *ff_Latn_BF) MonthWide(month time.Month) string {
137 return ff.monthsWide[month]
138 }
139
140
141 func (ff *ff_Latn_BF) MonthsWide() []string {
142 return ff.monthsWide[1:]
143 }
144
145
146 func (ff *ff_Latn_BF) WeekdayAbbreviated(weekday time.Weekday) string {
147 return ff.daysAbbreviated[weekday]
148 }
149
150
151 func (ff *ff_Latn_BF) WeekdaysAbbreviated() []string {
152 return ff.daysAbbreviated
153 }
154
155
156 func (ff *ff_Latn_BF) WeekdayNarrow(weekday time.Weekday) string {
157 return ff.daysNarrow[weekday]
158 }
159
160
161 func (ff *ff_Latn_BF) WeekdaysNarrow() []string {
162 return ff.daysNarrow
163 }
164
165
166 func (ff *ff_Latn_BF) WeekdayShort(weekday time.Weekday) string {
167 return ff.daysShort[weekday]
168 }
169
170
171 func (ff *ff_Latn_BF) WeekdaysShort() []string {
172 return ff.daysShort
173 }
174
175
176 func (ff *ff_Latn_BF) WeekdayWide(weekday time.Weekday) string {
177 return ff.daysWide[weekday]
178 }
179
180
181 func (ff *ff_Latn_BF) WeekdaysWide() []string {
182 return ff.daysWide
183 }
184
185
186 func (ff *ff_Latn_BF) Decimal() string {
187 return ff.decimal
188 }
189
190
191 func (ff *ff_Latn_BF) Group() string {
192 return ff.group
193 }
194
195
196 func (ff *ff_Latn_BF) Minus() string {
197 return ff.minus
198 }
199
200
201 func (ff *ff_Latn_BF) FmtNumber(num float64, v uint64) string {
202
203 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
204 }
205
206
207
208 func (ff *ff_Latn_BF) FmtPercent(num float64, v uint64) string {
209 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
210 }
211
212
213 func (ff *ff_Latn_BF) FmtCurrency(num float64, v uint64, currency currency.Type) string {
214
215 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
216 symbol := ff.currencies[currency]
217 l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
218 count := 0
219 inWhole := v == 0
220 b := make([]byte, 0, l)
221
222 for i := len(s) - 1; i >= 0; i-- {
223
224 if s[i] == '.' {
225 b = append(b, ff.decimal[0])
226 inWhole = true
227 continue
228 }
229
230 if inWhole {
231 if count == 3 {
232 for j := len(ff.group) - 1; j >= 0; j-- {
233 b = append(b, ff.group[j])
234 }
235 count = 1
236 } else {
237 count++
238 }
239 }
240
241 b = append(b, s[i])
242 }
243
244 if num < 0 {
245 b = append(b, ff.minus[0])
246 }
247
248
249 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
250 b[i], b[j] = b[j], b[i]
251 }
252
253 if int(v) < 2 {
254
255 if v == 0 {
256 b = append(b, ff.decimal...)
257 }
258
259 for i := 0; i < 2-int(v); i++ {
260 b = append(b, '0')
261 }
262 }
263
264 b = append(b, ff.currencyPositiveSuffix...)
265
266 b = append(b, symbol...)
267
268 return string(b)
269 }
270
271
272
273 func (ff *ff_Latn_BF) FmtAccounting(num float64, v uint64, currency currency.Type) string {
274
275 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
276 symbol := ff.currencies[currency]
277 l := len(s) + len(symbol) + 3 + 2*len(s[:len(s)-int(v)-1])/3
278 count := 0
279 inWhole := v == 0
280 b := make([]byte, 0, l)
281
282 for i := len(s) - 1; i >= 0; i-- {
283
284 if s[i] == '.' {
285 b = append(b, ff.decimal[0])
286 inWhole = true
287 continue
288 }
289
290 if inWhole {
291 if count == 3 {
292 for j := len(ff.group) - 1; j >= 0; j-- {
293 b = append(b, ff.group[j])
294 }
295 count = 1
296 } else {
297 count++
298 }
299 }
300
301 b = append(b, s[i])
302 }
303
304 if num < 0 {
305
306 b = append(b, ff.minus[0])
307
308 }
309
310
311 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
312 b[i], b[j] = b[j], b[i]
313 }
314
315 if int(v) < 2 {
316
317 if v == 0 {
318 b = append(b, ff.decimal...)
319 }
320
321 for i := 0; i < 2-int(v); i++ {
322 b = append(b, '0')
323 }
324 }
325
326 if num < 0 {
327 b = append(b, ff.currencyNegativeSuffix...)
328 b = append(b, symbol...)
329 } else {
330
331 b = append(b, ff.currencyPositiveSuffix...)
332 b = append(b, symbol...)
333 }
334
335 return string(b)
336 }
337
338
339 func (ff *ff_Latn_BF) FmtDateShort(t time.Time) string {
340
341 b := make([]byte, 0, 32)
342
343 b = strconv.AppendInt(b, int64(t.Day()), 10)
344 b = append(b, []byte{0x2f}...)
345 b = strconv.AppendInt(b, int64(t.Month()), 10)
346 b = append(b, []byte{0x2f}...)
347
348 if t.Year() > 0 {
349 b = strconv.AppendInt(b, int64(t.Year()), 10)
350 } else {
351 b = strconv.AppendInt(b, int64(-t.Year()), 10)
352 }
353
354 return string(b)
355 }
356
357
358 func (ff *ff_Latn_BF) FmtDateMedium(t time.Time) string {
359
360 b := make([]byte, 0, 32)
361
362 b = strconv.AppendInt(b, int64(t.Day()), 10)
363 b = append(b, []byte{0x20}...)
364 b = append(b, ff.monthsAbbreviated[t.Month()]...)
365 b = append(b, []byte{0x2c, 0x20}...)
366
367 if t.Year() > 0 {
368 b = strconv.AppendInt(b, int64(t.Year()), 10)
369 } else {
370 b = strconv.AppendInt(b, int64(-t.Year()), 10)
371 }
372
373 return string(b)
374 }
375
376
377 func (ff *ff_Latn_BF) FmtDateLong(t time.Time) string {
378
379 b := make([]byte, 0, 32)
380
381 b = strconv.AppendInt(b, int64(t.Day()), 10)
382 b = append(b, []byte{0x20}...)
383 b = append(b, ff.monthsWide[t.Month()]...)
384 b = append(b, []byte{0x20}...)
385
386 if t.Year() > 0 {
387 b = strconv.AppendInt(b, int64(t.Year()), 10)
388 } else {
389 b = strconv.AppendInt(b, int64(-t.Year()), 10)
390 }
391
392 return string(b)
393 }
394
395
396 func (ff *ff_Latn_BF) FmtDateFull(t time.Time) string {
397
398 b := make([]byte, 0, 32)
399
400 b = append(b, ff.daysWide[t.Weekday()]...)
401 b = append(b, []byte{0x20}...)
402 b = strconv.AppendInt(b, int64(t.Day()), 10)
403 b = append(b, []byte{0x20}...)
404 b = append(b, ff.monthsWide[t.Month()]...)
405 b = append(b, []byte{0x20}...)
406
407 if t.Year() > 0 {
408 b = strconv.AppendInt(b, int64(t.Year()), 10)
409 } else {
410 b = strconv.AppendInt(b, int64(-t.Year()), 10)
411 }
412
413 return string(b)
414 }
415
416
417 func (ff *ff_Latn_BF) FmtTimeShort(t time.Time) string {
418
419 b := make([]byte, 0, 32)
420
421 if t.Hour() < 10 {
422 b = append(b, '0')
423 }
424
425 b = strconv.AppendInt(b, int64(t.Hour()), 10)
426 b = append(b, ff.timeSeparator...)
427
428 if t.Minute() < 10 {
429 b = append(b, '0')
430 }
431
432 b = strconv.AppendInt(b, int64(t.Minute()), 10)
433
434 return string(b)
435 }
436
437
438 func (ff *ff_Latn_BF) FmtTimeMedium(t time.Time) string {
439
440 b := make([]byte, 0, 32)
441
442 if t.Hour() < 10 {
443 b = append(b, '0')
444 }
445
446 b = strconv.AppendInt(b, int64(t.Hour()), 10)
447 b = append(b, ff.timeSeparator...)
448
449 if t.Minute() < 10 {
450 b = append(b, '0')
451 }
452
453 b = strconv.AppendInt(b, int64(t.Minute()), 10)
454 b = append(b, ff.timeSeparator...)
455
456 if t.Second() < 10 {
457 b = append(b, '0')
458 }
459
460 b = strconv.AppendInt(b, int64(t.Second()), 10)
461
462 return string(b)
463 }
464
465
466 func (ff *ff_Latn_BF) FmtTimeLong(t time.Time) string {
467
468 b := make([]byte, 0, 32)
469
470 if t.Hour() < 10 {
471 b = append(b, '0')
472 }
473
474 b = strconv.AppendInt(b, int64(t.Hour()), 10)
475 b = append(b, ff.timeSeparator...)
476
477 if t.Minute() < 10 {
478 b = append(b, '0')
479 }
480
481 b = strconv.AppendInt(b, int64(t.Minute()), 10)
482 b = append(b, ff.timeSeparator...)
483
484 if t.Second() < 10 {
485 b = append(b, '0')
486 }
487
488 b = strconv.AppendInt(b, int64(t.Second()), 10)
489 b = append(b, []byte{0x20}...)
490
491 tz, _ := t.Zone()
492 b = append(b, tz...)
493
494 return string(b)
495 }
496
497
498 func (ff *ff_Latn_BF) FmtTimeFull(t time.Time) string {
499
500 b := make([]byte, 0, 32)
501
502 if t.Hour() < 10 {
503 b = append(b, '0')
504 }
505
506 b = strconv.AppendInt(b, int64(t.Hour()), 10)
507 b = append(b, ff.timeSeparator...)
508
509 if t.Minute() < 10 {
510 b = append(b, '0')
511 }
512
513 b = strconv.AppendInt(b, int64(t.Minute()), 10)
514 b = append(b, ff.timeSeparator...)
515
516 if t.Second() < 10 {
517 b = append(b, '0')
518 }
519
520 b = strconv.AppendInt(b, int64(t.Second()), 10)
521 b = append(b, []byte{0x20}...)
522
523 tz, _ := t.Zone()
524
525 if btz, ok := ff.timezones[tz]; ok {
526 b = append(b, btz...)
527 } else {
528 b = append(b, tz...)
529 }
530
531 return string(b)
532 }
533
View as plain text