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