1 package vai_Latn
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 vai_Latn 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 currencyNegativePrefix 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 &vai_Latn{
47 locale: "vai_Latn",
48 pluralsCardinal: nil,
49 pluralsOrdinal: nil,
50 pluralsRange: nil,
51 decimal: ".",
52 group: ",",
53 minus: "-",
54 percent: "%",
55 perMille: "‰",
56 timeSeparator: ":",
57 inifinity: "∞",
58 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", "$", "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"},
59 currencyNegativePrefix: "(",
60 currencyNegativeSuffix: ")",
61 monthsAbbreviated: []string{"", "ꖨꖕꔞ", "ꕒꕡ", "ꕾꖺ", "ꖢꖕ", "ꖑꕱ", "ꖱꘋ", "ꖱꕞ", "ꗛꔕ", "ꕢꕌ", "ꕭꖃ", "ꔞꘋ", "ꖨꖕꗏ"},
62 monthsNarrow: []string{"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12"},
63 monthsWide: []string{"", "luukao kemã", "ɓandaɓu", "vɔɔ", "fulu", "goo", "6", "7", "kɔnde", "saah", "galo", "kenpkato ɓololɔ", "luukao lɔma"},
64 daysNarrow: []string{"S", "M", "T", "W", "T", "F", "S"},
65 daysWide: []string{"lahadi", "tɛɛnɛɛ", "talata", "alaba", "aimisa", "aijima", "siɓiti"},
66 periodsAbbreviated: []string{"AM", "PM"},
67 periodsNarrow: []string{"", ""},
68 periodsWide: []string{"", ""},
69 erasAbbreviated: []string{"BCE", "CE"},
70 erasNarrow: []string{"", ""},
71 erasWide: []string{"", ""},
72 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", "∅∅∅": "∅∅∅"},
73 }
74 }
75
76
77 func (vai *vai_Latn) Locale() string {
78 return vai.locale
79 }
80
81
82 func (vai *vai_Latn) PluralsCardinal() []locales.PluralRule {
83 return vai.pluralsCardinal
84 }
85
86
87 func (vai *vai_Latn) PluralsOrdinal() []locales.PluralRule {
88 return vai.pluralsOrdinal
89 }
90
91
92 func (vai *vai_Latn) PluralsRange() []locales.PluralRule {
93 return vai.pluralsRange
94 }
95
96
97 func (vai *vai_Latn) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
98 return locales.PluralRuleUnknown
99 }
100
101
102 func (vai *vai_Latn) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
103 return locales.PluralRuleUnknown
104 }
105
106
107 func (vai *vai_Latn) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
108 return locales.PluralRuleUnknown
109 }
110
111
112 func (vai *vai_Latn) MonthAbbreviated(month time.Month) string {
113 return vai.monthsAbbreviated[month]
114 }
115
116
117 func (vai *vai_Latn) MonthsAbbreviated() []string {
118 return vai.monthsAbbreviated[1:]
119 }
120
121
122 func (vai *vai_Latn) MonthNarrow(month time.Month) string {
123 return vai.monthsNarrow[month]
124 }
125
126
127 func (vai *vai_Latn) MonthsNarrow() []string {
128 return vai.monthsNarrow[1:]
129 }
130
131
132 func (vai *vai_Latn) MonthWide(month time.Month) string {
133 return vai.monthsWide[month]
134 }
135
136
137 func (vai *vai_Latn) MonthsWide() []string {
138 return vai.monthsWide[1:]
139 }
140
141
142 func (vai *vai_Latn) WeekdayAbbreviated(weekday time.Weekday) string {
143 return vai.daysAbbreviated[weekday]
144 }
145
146
147 func (vai *vai_Latn) WeekdaysAbbreviated() []string {
148 return vai.daysAbbreviated
149 }
150
151
152 func (vai *vai_Latn) WeekdayNarrow(weekday time.Weekday) string {
153 return vai.daysNarrow[weekday]
154 }
155
156
157 func (vai *vai_Latn) WeekdaysNarrow() []string {
158 return vai.daysNarrow
159 }
160
161
162 func (vai *vai_Latn) WeekdayShort(weekday time.Weekday) string {
163 return vai.daysShort[weekday]
164 }
165
166
167 func (vai *vai_Latn) WeekdaysShort() []string {
168 return vai.daysShort
169 }
170
171
172 func (vai *vai_Latn) WeekdayWide(weekday time.Weekday) string {
173 return vai.daysWide[weekday]
174 }
175
176
177 func (vai *vai_Latn) WeekdaysWide() []string {
178 return vai.daysWide
179 }
180
181
182 func (vai *vai_Latn) Decimal() string {
183 return vai.decimal
184 }
185
186
187 func (vai *vai_Latn) Group() string {
188 return vai.group
189 }
190
191
192 func (vai *vai_Latn) Minus() string {
193 return vai.minus
194 }
195
196
197 func (vai *vai_Latn) FmtNumber(num float64, v uint64) string {
198
199 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
200 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
201 count := 0
202 inWhole := v == 0
203 b := make([]byte, 0, l)
204
205 for i := len(s) - 1; i >= 0; i-- {
206
207 if s[i] == '.' {
208 b = append(b, vai.decimal[0])
209 inWhole = true
210 continue
211 }
212
213 if inWhole {
214 if count == 3 {
215 b = append(b, vai.group[0])
216 count = 1
217 } else {
218 count++
219 }
220 }
221
222 b = append(b, s[i])
223 }
224
225 if num < 0 {
226 b = append(b, vai.minus[0])
227 }
228
229
230 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
231 b[i], b[j] = b[j], b[i]
232 }
233
234 return string(b)
235 }
236
237
238
239 func (vai *vai_Latn) FmtPercent(num float64, v uint64) string {
240 return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
241 }
242
243
244 func (vai *vai_Latn) FmtCurrency(num float64, v uint64, currency currency.Type) string {
245
246 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
247 symbol := vai.currencies[currency]
248 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
249 count := 0
250 inWhole := v == 0
251 b := make([]byte, 0, l)
252
253 for i := len(s) - 1; i >= 0; i-- {
254
255 if s[i] == '.' {
256 b = append(b, vai.decimal[0])
257 inWhole = true
258 continue
259 }
260
261 if inWhole {
262 if count == 3 {
263 b = append(b, vai.group[0])
264 count = 1
265 } else {
266 count++
267 }
268 }
269
270 b = append(b, s[i])
271 }
272
273 for j := len(symbol) - 1; j >= 0; j-- {
274 b = append(b, symbol[j])
275 }
276
277 if num < 0 {
278 b = append(b, vai.minus[0])
279 }
280
281
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]
284 }
285
286 if int(v) < 2 {
287
288 if v == 0 {
289 b = append(b, vai.decimal...)
290 }
291
292 for i := 0; i < 2-int(v); i++ {
293 b = append(b, '0')
294 }
295 }
296
297 return string(b)
298 }
299
300
301
302 func (vai *vai_Latn) FmtAccounting(num float64, v uint64, currency currency.Type) string {
303
304 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
305 symbol := vai.currencies[currency]
306 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
307 count := 0
308 inWhole := v == 0
309 b := make([]byte, 0, l)
310
311 for i := len(s) - 1; i >= 0; i-- {
312
313 if s[i] == '.' {
314 b = append(b, vai.decimal[0])
315 inWhole = true
316 continue
317 }
318
319 if inWhole {
320 if count == 3 {
321 b = append(b, vai.group[0])
322 count = 1
323 } else {
324 count++
325 }
326 }
327
328 b = append(b, s[i])
329 }
330
331 if num < 0 {
332
333 for j := len(symbol) - 1; j >= 0; j-- {
334 b = append(b, symbol[j])
335 }
336
337 b = append(b, vai.currencyNegativePrefix[0])
338
339 } else {
340
341 for j := len(symbol) - 1; j >= 0; j-- {
342 b = append(b, symbol[j])
343 }
344
345 }
346
347
348 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
349 b[i], b[j] = b[j], b[i]
350 }
351
352 if int(v) < 2 {
353
354 if v == 0 {
355 b = append(b, vai.decimal...)
356 }
357
358 for i := 0; i < 2-int(v); i++ {
359 b = append(b, '0')
360 }
361 }
362
363 if num < 0 {
364 b = append(b, vai.currencyNegativeSuffix...)
365 }
366
367 return string(b)
368 }
369
370
371 func (vai *vai_Latn) FmtDateShort(t time.Time) string {
372
373 b := make([]byte, 0, 32)
374
375 if t.Day() < 10 {
376 b = append(b, '0')
377 }
378
379 b = strconv.AppendInt(b, int64(t.Day()), 10)
380 b = append(b, []byte{0x2f}...)
381
382 if t.Month() < 10 {
383 b = append(b, '0')
384 }
385
386 b = strconv.AppendInt(b, int64(t.Month()), 10)
387
388 b = append(b, []byte{0x2f}...)
389
390 if t.Year() > 0 {
391 b = strconv.AppendInt(b, int64(t.Year()), 10)
392 } else {
393 b = strconv.AppendInt(b, int64(-t.Year()), 10)
394 }
395
396 return string(b)
397 }
398
399
400 func (vai *vai_Latn) FmtDateMedium(t time.Time) string {
401
402 b := make([]byte, 0, 32)
403
404 b = strconv.AppendInt(b, int64(t.Day()), 10)
405 b = append(b, []byte{0x20}...)
406 b = append(b, vai.monthsAbbreviated[t.Month()]...)
407 b = append(b, []byte{0x20}...)
408
409 if t.Year() > 0 {
410 b = strconv.AppendInt(b, int64(t.Year()), 10)
411 } else {
412 b = strconv.AppendInt(b, int64(-t.Year()), 10)
413 }
414
415 return string(b)
416 }
417
418
419 func (vai *vai_Latn) FmtDateLong(t time.Time) string {
420
421 b := make([]byte, 0, 32)
422
423 b = strconv.AppendInt(b, int64(t.Day()), 10)
424 b = append(b, []byte{0x20}...)
425 b = append(b, vai.monthsWide[t.Month()]...)
426 b = append(b, []byte{0x20}...)
427
428 if t.Year() > 0 {
429 b = strconv.AppendInt(b, int64(t.Year()), 10)
430 } else {
431 b = strconv.AppendInt(b, int64(-t.Year()), 10)
432 }
433
434 return string(b)
435 }
436
437
438 func (vai *vai_Latn) FmtDateFull(t time.Time) string {
439
440 b := make([]byte, 0, 32)
441
442 b = append(b, vai.daysWide[t.Weekday()]...)
443 b = append(b, []byte{0x2c, 0x20}...)
444 b = strconv.AppendInt(b, int64(t.Day()), 10)
445 b = append(b, []byte{0x20}...)
446 b = append(b, vai.monthsWide[t.Month()]...)
447 b = append(b, []byte{0x20}...)
448
449 if t.Year() > 0 {
450 b = strconv.AppendInt(b, int64(t.Year()), 10)
451 } else {
452 b = strconv.AppendInt(b, int64(-t.Year()), 10)
453 }
454
455 return string(b)
456 }
457
458
459 func (vai *vai_Latn) FmtTimeShort(t time.Time) string {
460
461 b := make([]byte, 0, 32)
462
463 h := t.Hour()
464
465 if h > 12 {
466 h -= 12
467 }
468
469 b = strconv.AppendInt(b, int64(h), 10)
470 b = append(b, vai.timeSeparator...)
471
472 if t.Minute() < 10 {
473 b = append(b, '0')
474 }
475
476 b = strconv.AppendInt(b, int64(t.Minute()), 10)
477 b = append(b, []byte{0x20}...)
478
479 if t.Hour() < 12 {
480 b = append(b, vai.periodsAbbreviated[0]...)
481 } else {
482 b = append(b, vai.periodsAbbreviated[1]...)
483 }
484
485 return string(b)
486 }
487
488
489 func (vai *vai_Latn) FmtTimeMedium(t time.Time) string {
490
491 b := make([]byte, 0, 32)
492
493 h := t.Hour()
494
495 if h > 12 {
496 h -= 12
497 }
498
499 b = strconv.AppendInt(b, int64(h), 10)
500 b = append(b, vai.timeSeparator...)
501
502 if t.Minute() < 10 {
503 b = append(b, '0')
504 }
505
506 b = strconv.AppendInt(b, int64(t.Minute()), 10)
507 b = append(b, vai.timeSeparator...)
508
509 if t.Second() < 10 {
510 b = append(b, '0')
511 }
512
513 b = strconv.AppendInt(b, int64(t.Second()), 10)
514 b = append(b, []byte{0x20}...)
515
516 if t.Hour() < 12 {
517 b = append(b, vai.periodsAbbreviated[0]...)
518 } else {
519 b = append(b, vai.periodsAbbreviated[1]...)
520 }
521
522 return string(b)
523 }
524
525
526 func (vai *vai_Latn) FmtTimeLong(t time.Time) string {
527
528 b := make([]byte, 0, 32)
529
530 h := t.Hour()
531
532 if h > 12 {
533 h -= 12
534 }
535
536 b = strconv.AppendInt(b, int64(h), 10)
537 b = append(b, vai.timeSeparator...)
538
539 if t.Minute() < 10 {
540 b = append(b, '0')
541 }
542
543 b = strconv.AppendInt(b, int64(t.Minute()), 10)
544 b = append(b, vai.timeSeparator...)
545
546 if t.Second() < 10 {
547 b = append(b, '0')
548 }
549
550 b = strconv.AppendInt(b, int64(t.Second()), 10)
551 b = append(b, []byte{0x20}...)
552
553 if t.Hour() < 12 {
554 b = append(b, vai.periodsAbbreviated[0]...)
555 } else {
556 b = append(b, vai.periodsAbbreviated[1]...)
557 }
558
559 b = append(b, []byte{0x20}...)
560
561 tz, _ := t.Zone()
562 b = append(b, tz...)
563
564 return string(b)
565 }
566
567
568 func (vai *vai_Latn) FmtTimeFull(t time.Time) string {
569
570 b := make([]byte, 0, 32)
571
572 h := t.Hour()
573
574 if h > 12 {
575 h -= 12
576 }
577
578 b = strconv.AppendInt(b, int64(h), 10)
579 b = append(b, vai.timeSeparator...)
580
581 if t.Minute() < 10 {
582 b = append(b, '0')
583 }
584
585 b = strconv.AppendInt(b, int64(t.Minute()), 10)
586 b = append(b, vai.timeSeparator...)
587
588 if t.Second() < 10 {
589 b = append(b, '0')
590 }
591
592 b = strconv.AppendInt(b, int64(t.Second()), 10)
593 b = append(b, []byte{0x20}...)
594
595 if t.Hour() < 12 {
596 b = append(b, vai.periodsAbbreviated[0]...)
597 } else {
598 b = append(b, vai.periodsAbbreviated[1]...)
599 }
600
601 b = append(b, []byte{0x20}...)
602
603 tz, _ := t.Zone()
604
605 if btz, ok := vai.timezones[tz]; ok {
606 b = append(b, btz...)
607 } else {
608 b = append(b, tz...)
609 }
610
611 return string(b)
612 }
613
View as plain text