OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / luy_KE / luy_KE.go
1 package luy_KE
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 luy_KE 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 // idx = enum of currency code
25         monthsAbbreviated  []string
26         monthsNarrow       []string
27         monthsWide         []string
28         daysAbbreviated    []string
29         daysNarrow         []string
30         daysShort          []string
31         daysWide           []string
32         periodsAbbreviated []string
33         periodsNarrow      []string
34         periodsShort       []string
35         periodsWide        []string
36         erasAbbreviated    []string
37         erasNarrow         []string
38         erasWide           []string
39         timezones          map[string]string
40 }
41
42 // New returns a new instance of translator for the 'luy_KE' locale
43 func New() locales.Translator {
44         return &luy_KE{
45                 locale:             "luy_KE",
46                 pluralsCardinal:    nil,
47                 pluralsOrdinal:     nil,
48                 pluralsRange:       nil,
49                 timeSeparator:      ":",
50                 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"},
51                 monthsAbbreviated:  []string{"", "Jan", "Feb", "Mar", "Apr", "Mei", "Jun", "Jul", "Ago", "Sep", "Okt", "Nov", "Des"},
52                 monthsNarrow:       []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
53                 monthsWide:         []string{"", "Januari", "Februari", "Machi", "Aprili", "Mei", "Juni", "Julai", "Agosti", "Septemba", "Oktoba", "Novemba", "Desemba"},
54                 daysAbbreviated:    []string{"J2", "J3", "J4", "J5", "Al", "Ij", "J1"},
55                 daysNarrow:         []string{"S", "M", "T", "W", "T", "F", "S"},
56                 daysWide:           []string{"Jumapiri", "Jumatatu", "Jumanne", "Jumatano", "Murwa wa Kanne", "Murwa wa Katano", "Jumamosi"},
57                 periodsAbbreviated: []string{"a.m.", "p.m."},
58                 periodsWide:        []string{"a.m.", "p.m."},
59                 erasAbbreviated:    []string{"BC", "AD"},
60                 erasNarrow:         []string{"", ""},
61                 erasWide:           []string{"Imberi ya Kuuza Kwa", "Muhiga Kuvita Kuuza"},
62                 timezones:          map[string]string{"AEDT": "AEDT", "COST": "COST", "CHADT": "CHADT", "CST": "CST", "NZDT": "NZDT", "JDT": "JDT", "SAST": "SAST", "GFT": "GFT", "ACDT": "ACDT", "∅∅∅": "∅∅∅", "ACWST": "ACWST", "LHST": "LHST", "WART": "WART", "ART": "ART", "CLT": "CLT", "CLST": "CLST", "PST": "PST", "HECU": "HECU", "HAST": "HAST", "HADT": "HADT", "ADT": "ADT", "COT": "COT", "AKDT": "AKDT", "ACWDT": "ACWDT", "NZST": "NZST", "WITA": "WITA", "CAT": "CAT", "UYST": "UYST", "TMST": "TMST", "EDT": "EDT", "AWST": "AWST", "WIT": "WIT", "VET": "VET", "HAT": "HAT", "BOT": "BOT", "CDT": "CDT", "OESZ": "OESZ", "HNPMX": "HNPMX", "HEPM": "HEPM", "BT": "BT", "HNNOMX": "HNNOMX", "AEST": "AEST", "HNEG": "HNEG", "ChST": "ChST", "PDT": "PDT", "HEEG": "HEEG", "HNPM": "HNPM", "UYT": "UYT", "SGT": "SGT", "HNCU": "HNCU", "TMT": "TMT", "ACST": "ACST", "ECT": "ECT", "SRT": "SRT", "HEOG": "HEOG", "LHDT": "LHDT", "IST": "IST", "AST": "AST", "ARST": "ARST", "HKT": "HKT", "HKST": "HKST", "HEPMX": "HEPMX", "WIB": "WIB", "GYT": "GYT", "WESZ": "WESZ", "AWDT": "AWDT", "MESZ": "MESZ", "OEZ": "OEZ", "WARST": "WARST", "EAT": "EAT", "AKST": "AKST", "WEZ": "WEZ", "MYT": "MYT", "MEZ": "MEZ", "JST": "JST", "EST": "EST", "GMT": "GMT", "MST": "MST", "HENOMX": "HENOMX", "HNOG": "HNOG", "WAT": "WAT", "WAST": "WAST", "HNT": "HNT", "CHAST": "CHAST", "MDT": "MDT"},
63         }
64 }
65
66 // Locale returns the current translators string locale
67 func (luy *luy_KE) Locale() string {
68         return luy.locale
69 }
70
71 // PluralsCardinal returns the list of cardinal plural rules associated with 'luy_KE'
72 func (luy *luy_KE) PluralsCardinal() []locales.PluralRule {
73         return luy.pluralsCardinal
74 }
75
76 // PluralsOrdinal returns the list of ordinal plural rules associated with 'luy_KE'
77 func (luy *luy_KE) PluralsOrdinal() []locales.PluralRule {
78         return luy.pluralsOrdinal
79 }
80
81 // PluralsRange returns the list of range plural rules associated with 'luy_KE'
82 func (luy *luy_KE) PluralsRange() []locales.PluralRule {
83         return luy.pluralsRange
84 }
85
86 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'luy_KE'
87 func (luy *luy_KE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
88         return locales.PluralRuleUnknown
89 }
90
91 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'luy_KE'
92 func (luy *luy_KE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
93         return locales.PluralRuleUnknown
94 }
95
96 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'luy_KE'
97 func (luy *luy_KE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
98         return locales.PluralRuleUnknown
99 }
100
101 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
102 func (luy *luy_KE) MonthAbbreviated(month time.Month) string {
103         return luy.monthsAbbreviated[month]
104 }
105
106 // MonthsAbbreviated returns the locales abbreviated months
107 func (luy *luy_KE) MonthsAbbreviated() []string {
108         return luy.monthsAbbreviated[1:]
109 }
110
111 // MonthNarrow returns the locales narrow month given the 'month' provided
112 func (luy *luy_KE) MonthNarrow(month time.Month) string {
113         return luy.monthsNarrow[month]
114 }
115
116 // MonthsNarrow returns the locales narrow months
117 func (luy *luy_KE) MonthsNarrow() []string {
118         return luy.monthsNarrow[1:]
119 }
120
121 // MonthWide returns the locales wide month given the 'month' provided
122 func (luy *luy_KE) MonthWide(month time.Month) string {
123         return luy.monthsWide[month]
124 }
125
126 // MonthsWide returns the locales wide months
127 func (luy *luy_KE) MonthsWide() []string {
128         return luy.monthsWide[1:]
129 }
130
131 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
132 func (luy *luy_KE) WeekdayAbbreviated(weekday time.Weekday) string {
133         return luy.daysAbbreviated[weekday]
134 }
135
136 // WeekdaysAbbreviated returns the locales abbreviated weekdays
137 func (luy *luy_KE) WeekdaysAbbreviated() []string {
138         return luy.daysAbbreviated
139 }
140
141 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
142 func (luy *luy_KE) WeekdayNarrow(weekday time.Weekday) string {
143         return luy.daysNarrow[weekday]
144 }
145
146 // WeekdaysNarrow returns the locales narrow weekdays
147 func (luy *luy_KE) WeekdaysNarrow() []string {
148         return luy.daysNarrow
149 }
150
151 // WeekdayShort returns the locales short weekday given the 'weekday' provided
152 func (luy *luy_KE) WeekdayShort(weekday time.Weekday) string {
153         return luy.daysShort[weekday]
154 }
155
156 // WeekdaysShort returns the locales short weekdays
157 func (luy *luy_KE) WeekdaysShort() []string {
158         return luy.daysShort
159 }
160
161 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
162 func (luy *luy_KE) WeekdayWide(weekday time.Weekday) string {
163         return luy.daysWide[weekday]
164 }
165
166 // WeekdaysWide returns the locales wide weekdays
167 func (luy *luy_KE) WeekdaysWide() []string {
168         return luy.daysWide
169 }
170
171 // Decimal returns the decimal point of number
172 func (luy *luy_KE) Decimal() string {
173         return luy.decimal
174 }
175
176 // Group returns the group of number
177 func (luy *luy_KE) Group() string {
178         return luy.group
179 }
180
181 // Group returns the minus sign of number
182 func (luy *luy_KE) Minus() string {
183         return luy.minus
184 }
185
186 // FmtNumber returns 'num' with digits/precision of 'v' for 'luy_KE' and handles both Whole and Real numbers based on 'v'
187 func (luy *luy_KE) FmtNumber(num float64, v uint64) string {
188
189         return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
190 }
191
192 // FmtPercent returns 'num' with digits/precision of 'v' for 'luy_KE' and handles both Whole and Real numbers based on 'v'
193 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
194 func (luy *luy_KE) FmtPercent(num float64, v uint64) string {
195         return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
196 }
197
198 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'luy_KE'
199 func (luy *luy_KE) FmtCurrency(num float64, v uint64, currency currency.Type) string {
200
201         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
202         symbol := luy.currencies[currency]
203         l := len(s) + len(symbol) + 0
204         count := 0
205         inWhole := v == 0
206         b := make([]byte, 0, l)
207
208         for i := len(s) - 1; i >= 0; i-- {
209
210                 if s[i] == '.' {
211                         b = append(b, luy.decimal[0])
212                         inWhole = true
213                         continue
214                 }
215
216                 if inWhole {
217                         if count == 3 {
218                                 b = append(b, luy.group[0])
219                                 count = 1
220                         } else {
221                                 count++
222                         }
223                 }
224
225                 b = append(b, s[i])
226         }
227
228         for j := len(symbol) - 1; j >= 0; j-- {
229                 b = append(b, symbol[j])
230         }
231
232         if num < 0 {
233                 b = append(b, luy.minus[0])
234         }
235
236         // reverse
237         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
238                 b[i], b[j] = b[j], b[i]
239         }
240
241         if int(v) < 2 {
242
243                 if v == 0 {
244                         b = append(b, luy.decimal...)
245                 }
246
247                 for i := 0; i < 2-int(v); i++ {
248                         b = append(b, '0')
249                 }
250         }
251
252         return string(b)
253 }
254
255 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'luy_KE'
256 // in accounting notation.
257 func (luy *luy_KE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
258
259         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
260         symbol := luy.currencies[currency]
261         l := len(s) + len(symbol) + 0
262         count := 0
263         inWhole := v == 0
264         b := make([]byte, 0, l)
265
266         for i := len(s) - 1; i >= 0; i-- {
267
268                 if s[i] == '.' {
269                         b = append(b, luy.decimal[0])
270                         inWhole = true
271                         continue
272                 }
273
274                 if inWhole {
275                         if count == 3 {
276                                 b = append(b, luy.group[0])
277                                 count = 1
278                         } else {
279                                 count++
280                         }
281                 }
282
283                 b = append(b, s[i])
284         }
285
286         if num < 0 {
287
288                 for j := len(symbol) - 1; j >= 0; j-- {
289                         b = append(b, symbol[j])
290                 }
291
292                 b = append(b, luy.minus[0])
293
294         } else {
295
296                 for j := len(symbol) - 1; j >= 0; j-- {
297                         b = append(b, symbol[j])
298                 }
299
300         }
301
302         // reverse
303         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
304                 b[i], b[j] = b[j], b[i]
305         }
306
307         if int(v) < 2 {
308
309                 if v == 0 {
310                         b = append(b, luy.decimal...)
311                 }
312
313                 for i := 0; i < 2-int(v); i++ {
314                         b = append(b, '0')
315                 }
316         }
317
318         return string(b)
319 }
320
321 // FmtDateShort returns the short date representation of 't' for 'luy_KE'
322 func (luy *luy_KE) FmtDateShort(t time.Time) string {
323
324         b := make([]byte, 0, 32)
325
326         if t.Day() < 10 {
327                 b = append(b, '0')
328         }
329
330         b = strconv.AppendInt(b, int64(t.Day()), 10)
331         b = append(b, []byte{0x2f}...)
332
333         if t.Month() < 10 {
334                 b = append(b, '0')
335         }
336
337         b = strconv.AppendInt(b, int64(t.Month()), 10)
338
339         b = append(b, []byte{0x2f}...)
340
341         if t.Year() > 0 {
342                 b = strconv.AppendInt(b, int64(t.Year()), 10)
343         } else {
344                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
345         }
346
347         return string(b)
348 }
349
350 // FmtDateMedium returns the medium date representation of 't' for 'luy_KE'
351 func (luy *luy_KE) FmtDateMedium(t time.Time) string {
352
353         b := make([]byte, 0, 32)
354
355         b = strconv.AppendInt(b, int64(t.Day()), 10)
356         b = append(b, []byte{0x20}...)
357         b = append(b, luy.monthsAbbreviated[t.Month()]...)
358         b = append(b, []byte{0x20}...)
359
360         if t.Year() > 0 {
361                 b = strconv.AppendInt(b, int64(t.Year()), 10)
362         } else {
363                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
364         }
365
366         return string(b)
367 }
368
369 // FmtDateLong returns the long date representation of 't' for 'luy_KE'
370 func (luy *luy_KE) FmtDateLong(t time.Time) string {
371
372         b := make([]byte, 0, 32)
373
374         b = strconv.AppendInt(b, int64(t.Day()), 10)
375         b = append(b, []byte{0x20}...)
376         b = append(b, luy.monthsWide[t.Month()]...)
377         b = append(b, []byte{0x20}...)
378
379         if t.Year() > 0 {
380                 b = strconv.AppendInt(b, int64(t.Year()), 10)
381         } else {
382                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
383         }
384
385         return string(b)
386 }
387
388 // FmtDateFull returns the full date representation of 't' for 'luy_KE'
389 func (luy *luy_KE) FmtDateFull(t time.Time) string {
390
391         b := make([]byte, 0, 32)
392
393         b = append(b, luy.daysWide[t.Weekday()]...)
394         b = append(b, []byte{0x2c, 0x20}...)
395         b = strconv.AppendInt(b, int64(t.Day()), 10)
396         b = append(b, []byte{0x20}...)
397         b = append(b, luy.monthsWide[t.Month()]...)
398         b = append(b, []byte{0x20}...)
399
400         if t.Year() > 0 {
401                 b = strconv.AppendInt(b, int64(t.Year()), 10)
402         } else {
403                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
404         }
405
406         return string(b)
407 }
408
409 // FmtTimeShort returns the short time representation of 't' for 'luy_KE'
410 func (luy *luy_KE) FmtTimeShort(t time.Time) string {
411
412         b := make([]byte, 0, 32)
413
414         if t.Hour() < 10 {
415                 b = append(b, '0')
416         }
417
418         b = strconv.AppendInt(b, int64(t.Hour()), 10)
419         b = append(b, luy.timeSeparator...)
420
421         if t.Minute() < 10 {
422                 b = append(b, '0')
423         }
424
425         b = strconv.AppendInt(b, int64(t.Minute()), 10)
426
427         return string(b)
428 }
429
430 // FmtTimeMedium returns the medium time representation of 't' for 'luy_KE'
431 func (luy *luy_KE) FmtTimeMedium(t time.Time) string {
432
433         b := make([]byte, 0, 32)
434
435         if t.Hour() < 10 {
436                 b = append(b, '0')
437         }
438
439         b = strconv.AppendInt(b, int64(t.Hour()), 10)
440         b = append(b, luy.timeSeparator...)
441
442         if t.Minute() < 10 {
443                 b = append(b, '0')
444         }
445
446         b = strconv.AppendInt(b, int64(t.Minute()), 10)
447         b = append(b, luy.timeSeparator...)
448
449         if t.Second() < 10 {
450                 b = append(b, '0')
451         }
452
453         b = strconv.AppendInt(b, int64(t.Second()), 10)
454
455         return string(b)
456 }
457
458 // FmtTimeLong returns the long time representation of 't' for 'luy_KE'
459 func (luy *luy_KE) FmtTimeLong(t time.Time) string {
460
461         b := make([]byte, 0, 32)
462
463         if t.Hour() < 10 {
464                 b = append(b, '0')
465         }
466
467         b = strconv.AppendInt(b, int64(t.Hour()), 10)
468         b = append(b, luy.timeSeparator...)
469
470         if t.Minute() < 10 {
471                 b = append(b, '0')
472         }
473
474         b = strconv.AppendInt(b, int64(t.Minute()), 10)
475         b = append(b, luy.timeSeparator...)
476
477         if t.Second() < 10 {
478                 b = append(b, '0')
479         }
480
481         b = strconv.AppendInt(b, int64(t.Second()), 10)
482         b = append(b, []byte{0x20}...)
483
484         tz, _ := t.Zone()
485         b = append(b, tz...)
486
487         return string(b)
488 }
489
490 // FmtTimeFull returns the full time representation of 't' for 'luy_KE'
491 func (luy *luy_KE) FmtTimeFull(t time.Time) string {
492
493         b := make([]byte, 0, 32)
494
495         if t.Hour() < 10 {
496                 b = append(b, '0')
497         }
498
499         b = strconv.AppendInt(b, int64(t.Hour()), 10)
500         b = append(b, luy.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, luy.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         tz, _ := t.Zone()
517
518         if btz, ok := luy.timezones[tz]; ok {
519                 b = append(b, btz...)
520         } else {
521                 b = append(b, tz...)
522         }
523
524         return string(b)
525 }