OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / lg_UG / lg_UG.go
1 package lg_UG
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 lg_UG 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 'lg_UG' locale
43 func New() locales.Translator {
44         return &lg_UG{
45                 locale:            "lg_UG",
46                 pluralsCardinal:   []locales.PluralRule{2, 6},
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", "Apu", "Maa", "Juu", "Jul", "Agu", "Seb", "Oki", "Nov", "Des"},
52                 monthsNarrow:      []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
53                 monthsWide:        []string{"", "Janwaliyo", "Febwaliyo", "Marisi", "Apuli", "Maayi", "Juuni", "Julaayi", "Agusito", "Sebuttemba", "Okitobba", "Novemba", "Desemba"},
54                 daysAbbreviated:   []string{"Sab", "Bal", "Lw2", "Lw3", "Lw4", "Lw5", "Lw6"},
55                 daysNarrow:        []string{"S", "B", "L", "L", "L", "L", "L"},
56                 daysWide:          []string{"Sabbiiti", "Balaza", "Lwakubiri", "Lwakusatu", "Lwakuna", "Lwakutaano", "Lwamukaaga"},
57                 erasAbbreviated:   []string{"BC", "AD"},
58                 erasNarrow:        []string{"", ""},
59                 erasWide:          []string{"Kulisito nga tannaza", "Bukya Kulisito Azaal"},
60                 timezones:         map[string]string{"WIT": "WIT", "OEZ": "OEZ", "AKDT": "AKDT", "GMT": "GMT", "ACST": "ACST", "HEPMX": "HEPMX", "PST": "PST", "HNCU": "HNCU", "HADT": "HADT", "WITA": "WITA", "IST": "IST", "CST": "CST", "HNOG": "HNOG", "EDT": "EDT", "∅∅∅": "∅∅∅", "BOT": "BOT", "ACWST": "ACWST", "MESZ": "MESZ", "AKST": "AKST", "NZDT": "NZDT", "LHDT": "LHDT", "EAT": "EAT", "HNEG": "HNEG", "HNT": "HNT", "MST": "MST", "SRT": "SRT", "HAST": "HAST", "WAT": "WAT", "GFT": "GFT", "HEEG": "HEEG", "HAT": "HAT", "WIB": "WIB", "CDT": "CDT", "TMT": "TMT", "JDT": "JDT", "LHST": "LHST", "WART": "WART", "CLST": "CLST", "ECT": "ECT", "CAT": "CAT", "SGT": "SGT", "NZST": "NZST", "AEST": "AEST", "HEOG": "HEOG", "CLT": "CLT", "GYT": "GYT", "ACDT": "ACDT", "PDT": "PDT", "AWDT": "AWDT", "UYST": "UYST", "WESZ": "WESZ", "HECU": "HECU", "HEPM": "HEPM", "MEZ": "MEZ", "HENOMX": "HENOMX", "HKT": "HKT", "COT": "COT", "WEZ": "WEZ", "CHAST": "CHAST", "AWST": "AWST", "VET": "VET", "AST": "AST", "ADT": "ADT", "AEDT": "AEDT", "UYT": "UYT", "JST": "JST", "HNNOMX": "HNNOMX", "SAST": "SAST", "CHADT": "CHADT", "HNPM": "HNPM", "WARST": "WARST", "ChST": "ChST", "HNPMX": "HNPMX", "BT": "BT", "TMST": "TMST", "HKST": "HKST", "COST": "COST", "WAST": "WAST", "EST": "EST", "MDT": "MDT", "ACWDT": "ACWDT", "MYT": "MYT", "OESZ": "OESZ", "ART": "ART", "ARST": "ARST"},
61         }
62 }
63
64 // Locale returns the current translators string locale
65 func (lg *lg_UG) Locale() string {
66         return lg.locale
67 }
68
69 // PluralsCardinal returns the list of cardinal plural rules associated with 'lg_UG'
70 func (lg *lg_UG) PluralsCardinal() []locales.PluralRule {
71         return lg.pluralsCardinal
72 }
73
74 // PluralsOrdinal returns the list of ordinal plural rules associated with 'lg_UG'
75 func (lg *lg_UG) PluralsOrdinal() []locales.PluralRule {
76         return lg.pluralsOrdinal
77 }
78
79 // PluralsRange returns the list of range plural rules associated with 'lg_UG'
80 func (lg *lg_UG) PluralsRange() []locales.PluralRule {
81         return lg.pluralsRange
82 }
83
84 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'lg_UG'
85 func (lg *lg_UG) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
86
87         n := math.Abs(num)
88
89         if n == 1 {
90                 return locales.PluralRuleOne
91         }
92
93         return locales.PluralRuleOther
94 }
95
96 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'lg_UG'
97 func (lg *lg_UG) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
98         return locales.PluralRuleUnknown
99 }
100
101 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'lg_UG'
102 func (lg *lg_UG) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
103         return locales.PluralRuleUnknown
104 }
105
106 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
107 func (lg *lg_UG) MonthAbbreviated(month time.Month) string {
108         return lg.monthsAbbreviated[month]
109 }
110
111 // MonthsAbbreviated returns the locales abbreviated months
112 func (lg *lg_UG) MonthsAbbreviated() []string {
113         return lg.monthsAbbreviated[1:]
114 }
115
116 // MonthNarrow returns the locales narrow month given the 'month' provided
117 func (lg *lg_UG) MonthNarrow(month time.Month) string {
118         return lg.monthsNarrow[month]
119 }
120
121 // MonthsNarrow returns the locales narrow months
122 func (lg *lg_UG) MonthsNarrow() []string {
123         return lg.monthsNarrow[1:]
124 }
125
126 // MonthWide returns the locales wide month given the 'month' provided
127 func (lg *lg_UG) MonthWide(month time.Month) string {
128         return lg.monthsWide[month]
129 }
130
131 // MonthsWide returns the locales wide months
132 func (lg *lg_UG) MonthsWide() []string {
133         return lg.monthsWide[1:]
134 }
135
136 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
137 func (lg *lg_UG) WeekdayAbbreviated(weekday time.Weekday) string {
138         return lg.daysAbbreviated[weekday]
139 }
140
141 // WeekdaysAbbreviated returns the locales abbreviated weekdays
142 func (lg *lg_UG) WeekdaysAbbreviated() []string {
143         return lg.daysAbbreviated
144 }
145
146 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
147 func (lg *lg_UG) WeekdayNarrow(weekday time.Weekday) string {
148         return lg.daysNarrow[weekday]
149 }
150
151 // WeekdaysNarrow returns the locales narrow weekdays
152 func (lg *lg_UG) WeekdaysNarrow() []string {
153         return lg.daysNarrow
154 }
155
156 // WeekdayShort returns the locales short weekday given the 'weekday' provided
157 func (lg *lg_UG) WeekdayShort(weekday time.Weekday) string {
158         return lg.daysShort[weekday]
159 }
160
161 // WeekdaysShort returns the locales short weekdays
162 func (lg *lg_UG) WeekdaysShort() []string {
163         return lg.daysShort
164 }
165
166 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
167 func (lg *lg_UG) WeekdayWide(weekday time.Weekday) string {
168         return lg.daysWide[weekday]
169 }
170
171 // WeekdaysWide returns the locales wide weekdays
172 func (lg *lg_UG) WeekdaysWide() []string {
173         return lg.daysWide
174 }
175
176 // Decimal returns the decimal point of number
177 func (lg *lg_UG) Decimal() string {
178         return lg.decimal
179 }
180
181 // Group returns the group of number
182 func (lg *lg_UG) Group() string {
183         return lg.group
184 }
185
186 // Group returns the minus sign of number
187 func (lg *lg_UG) Minus() string {
188         return lg.minus
189 }
190
191 // FmtNumber returns 'num' with digits/precision of 'v' for 'lg_UG' and handles both Whole and Real numbers based on 'v'
192 func (lg *lg_UG) FmtNumber(num float64, v uint64) string {
193
194         return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
195 }
196
197 // FmtPercent returns 'num' with digits/precision of 'v' for 'lg_UG' and handles both Whole and Real numbers based on 'v'
198 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
199 func (lg *lg_UG) FmtPercent(num float64, v uint64) string {
200         return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
201 }
202
203 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'lg_UG'
204 func (lg *lg_UG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
205
206         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
207         symbol := lg.currencies[currency]
208         l := len(s) + len(symbol) + 0
209         count := 0
210         inWhole := v == 0
211         b := make([]byte, 0, l)
212
213         for i := len(s) - 1; i >= 0; i-- {
214
215                 if s[i] == '.' {
216                         b = append(b, lg.decimal[0])
217                         inWhole = true
218                         continue
219                 }
220
221                 if inWhole {
222                         if count == 3 {
223                                 b = append(b, lg.group[0])
224                                 count = 1
225                         } else {
226                                 count++
227                         }
228                 }
229
230                 b = append(b, s[i])
231         }
232
233         if num < 0 {
234                 b = append(b, lg.minus[0])
235         }
236
237         // reverse
238         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
239                 b[i], b[j] = b[j], b[i]
240         }
241
242         if int(v) < 2 {
243
244                 if v == 0 {
245                         b = append(b, lg.decimal...)
246                 }
247
248                 for i := 0; i < 2-int(v); i++ {
249                         b = append(b, '0')
250                 }
251         }
252
253         b = append(b, symbol...)
254
255         return string(b)
256 }
257
258 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'lg_UG'
259 // in accounting notation.
260 func (lg *lg_UG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
261
262         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
263         symbol := lg.currencies[currency]
264         l := len(s) + len(symbol) + 0
265         count := 0
266         inWhole := v == 0
267         b := make([]byte, 0, l)
268
269         for i := len(s) - 1; i >= 0; i-- {
270
271                 if s[i] == '.' {
272                         b = append(b, lg.decimal[0])
273                         inWhole = true
274                         continue
275                 }
276
277                 if inWhole {
278                         if count == 3 {
279                                 b = append(b, lg.group[0])
280                                 count = 1
281                         } else {
282                                 count++
283                         }
284                 }
285
286                 b = append(b, s[i])
287         }
288
289         if num < 0 {
290
291                 b = append(b, lg.minus[0])
292
293         }
294
295         // reverse
296         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
297                 b[i], b[j] = b[j], b[i]
298         }
299
300         if int(v) < 2 {
301
302                 if v == 0 {
303                         b = append(b, lg.decimal...)
304                 }
305
306                 for i := 0; i < 2-int(v); i++ {
307                         b = append(b, '0')
308                 }
309         }
310
311         if num < 0 {
312                 b = append(b, symbol...)
313         } else {
314
315                 b = append(b, symbol...)
316         }
317
318         return string(b)
319 }
320
321 // FmtDateShort returns the short date representation of 't' for 'lg_UG'
322 func (lg *lg_UG) 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 'lg_UG'
351 func (lg *lg_UG) 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, lg.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 'lg_UG'
370 func (lg *lg_UG) 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, lg.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 'lg_UG'
389 func (lg *lg_UG) FmtDateFull(t time.Time) string {
390
391         b := make([]byte, 0, 32)
392
393         b = append(b, lg.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, lg.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 'lg_UG'
410 func (lg *lg_UG) 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, lg.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 'lg_UG'
431 func (lg *lg_UG) 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, lg.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, lg.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 'lg_UG'
459 func (lg *lg_UG) 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, lg.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, lg.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 'lg_UG'
491 func (lg *lg_UG) 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, lg.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, lg.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 := lg.timezones[tz]; ok {
519                 b = append(b, btz...)
520         } else {
521                 b = append(b, tz...)
522         }
523
524         return string(b)
525 }