OSDN Git Service

delete miner
[bytom/vapor.git] / vendor / github.com / go-playground / locales / cgg_UG / cgg_UG.go
1 package cgg_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 cgg_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 'cgg_UG' locale
43 func New() locales.Translator {
44         return &cgg_UG{
45                 locale:            "cgg_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{"", "KBZ", "KBR", "KST", "KKN", "KTN", "KMK", "KMS", "KMN", "KMW", "KKM", "KNK", "KNB"},
52                 monthsNarrow:      []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
53                 monthsWide:        []string{"", "Okwokubanza", "Okwakabiri", "Okwakashatu", "Okwakana", "Okwakataana", "Okwamukaaga", "Okwamushanju", "Okwamunaana", "Okwamwenda", "Okwaikumi", "Okwaikumi na kumwe", "Okwaikumi na ibiri"},
54                 daysAbbreviated:   []string{"SAN", "ORK", "OKB", "OKS", "OKN", "OKT", "OMK"},
55                 daysNarrow:        []string{"S", "K", "R", "S", "N", "T", "M"},
56                 daysWide:          []string{"Sande", "Orwokubanza", "Orwakabiri", "Orwakashatu", "Orwakana", "Orwakataano", "Orwamukaaga"},
57                 erasAbbreviated:   []string{"BC", "AD"},
58                 erasNarrow:        []string{"", ""},
59                 erasWide:          []string{"Kurisito Atakaijire", "Kurisito Yaijire"},
60                 timezones:         map[string]string{"HNPMX": "HNPMX", "HNPM": "HNPM", "WARST": "WARST", "HNEG": "HNEG", "HNT": "HNT", "EST": "EST", "HADT": "HADT", "∅∅∅": "∅∅∅", "MST": "MST", "AEDT": "AEDT", "WAT": "WAT", "HKT": "HKT", "ACST": "ACST", "CAT": "CAT", "GMT": "GMT", "LHDT": "LHDT", "CHADT": "CHADT", "CDT": "CDT", "ACWST": "ACWST", "ACWDT": "ACWDT", "TMT": "TMT", "MESZ": "MESZ", "HEPM": "HEPM", "MDT": "MDT", "GYT": "GYT", "ACDT": "ACDT", "BOT": "BOT", "HNNOMX": "HNNOMX", "EDT": "EDT", "WIB": "WIB", "PST": "PST", "BT": "BT", "NZDT": "NZDT", "ART": "ART", "ChST": "ChST", "WIT": "WIT", "TMST": "TMST", "ECT": "ECT", "JST": "JST", "SAST": "SAST", "WAST": "WAST", "COT": "COT", "AKST": "AKST", "SGT": "SGT", "HNCU": "HNCU", "WITA": "WITA", "NZST": "NZST", "HENOMX": "HENOMX", "IST": "IST", "HAT": "HAT", "AKDT": "AKDT", "UYT": "UYT", "MEZ": "MEZ", "WART": "WART", "UYST": "UYST", "OESZ": "OESZ", "COST": "COST", "HKST": "HKST", "WEZ": "WEZ", "CST": "CST", "AWST": "AWST", "ADT": "ADT", "AST": "AST", "AEST": "AEST", "ARST": "ARST", "EAT": "EAT", "CLT": "CLT", "HEPMX": "HEPMX", "CHAST": "CHAST", "JDT": "JDT", "SRT": "SRT", "HNOG": "HNOG", "GFT": "GFT", "WESZ": "WESZ", "AWDT": "AWDT", "VET": "VET", "LHST": "LHST", "HEOG": "HEOG", "HEEG": "HEEG", "CLST": "CLST", "HECU": "HECU", "HAST": "HAST", "OEZ": "OEZ", "MYT": "MYT", "PDT": "PDT"},
61         }
62 }
63
64 // Locale returns the current translators string locale
65 func (cgg *cgg_UG) Locale() string {
66         return cgg.locale
67 }
68
69 // PluralsCardinal returns the list of cardinal plural rules associated with 'cgg_UG'
70 func (cgg *cgg_UG) PluralsCardinal() []locales.PluralRule {
71         return cgg.pluralsCardinal
72 }
73
74 // PluralsOrdinal returns the list of ordinal plural rules associated with 'cgg_UG'
75 func (cgg *cgg_UG) PluralsOrdinal() []locales.PluralRule {
76         return cgg.pluralsOrdinal
77 }
78
79 // PluralsRange returns the list of range plural rules associated with 'cgg_UG'
80 func (cgg *cgg_UG) PluralsRange() []locales.PluralRule {
81         return cgg.pluralsRange
82 }
83
84 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'cgg_UG'
85 func (cgg *cgg_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 'cgg_UG'
97 func (cgg *cgg_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 'cgg_UG'
102 func (cgg *cgg_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 (cgg *cgg_UG) MonthAbbreviated(month time.Month) string {
108         return cgg.monthsAbbreviated[month]
109 }
110
111 // MonthsAbbreviated returns the locales abbreviated months
112 func (cgg *cgg_UG) MonthsAbbreviated() []string {
113         return cgg.monthsAbbreviated[1:]
114 }
115
116 // MonthNarrow returns the locales narrow month given the 'month' provided
117 func (cgg *cgg_UG) MonthNarrow(month time.Month) string {
118         return cgg.monthsNarrow[month]
119 }
120
121 // MonthsNarrow returns the locales narrow months
122 func (cgg *cgg_UG) MonthsNarrow() []string {
123         return cgg.monthsNarrow[1:]
124 }
125
126 // MonthWide returns the locales wide month given the 'month' provided
127 func (cgg *cgg_UG) MonthWide(month time.Month) string {
128         return cgg.monthsWide[month]
129 }
130
131 // MonthsWide returns the locales wide months
132 func (cgg *cgg_UG) MonthsWide() []string {
133         return cgg.monthsWide[1:]
134 }
135
136 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
137 func (cgg *cgg_UG) WeekdayAbbreviated(weekday time.Weekday) string {
138         return cgg.daysAbbreviated[weekday]
139 }
140
141 // WeekdaysAbbreviated returns the locales abbreviated weekdays
142 func (cgg *cgg_UG) WeekdaysAbbreviated() []string {
143         return cgg.daysAbbreviated
144 }
145
146 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
147 func (cgg *cgg_UG) WeekdayNarrow(weekday time.Weekday) string {
148         return cgg.daysNarrow[weekday]
149 }
150
151 // WeekdaysNarrow returns the locales narrow weekdays
152 func (cgg *cgg_UG) WeekdaysNarrow() []string {
153         return cgg.daysNarrow
154 }
155
156 // WeekdayShort returns the locales short weekday given the 'weekday' provided
157 func (cgg *cgg_UG) WeekdayShort(weekday time.Weekday) string {
158         return cgg.daysShort[weekday]
159 }
160
161 // WeekdaysShort returns the locales short weekdays
162 func (cgg *cgg_UG) WeekdaysShort() []string {
163         return cgg.daysShort
164 }
165
166 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
167 func (cgg *cgg_UG) WeekdayWide(weekday time.Weekday) string {
168         return cgg.daysWide[weekday]
169 }
170
171 // WeekdaysWide returns the locales wide weekdays
172 func (cgg *cgg_UG) WeekdaysWide() []string {
173         return cgg.daysWide
174 }
175
176 // Decimal returns the decimal point of number
177 func (cgg *cgg_UG) Decimal() string {
178         return cgg.decimal
179 }
180
181 // Group returns the group of number
182 func (cgg *cgg_UG) Group() string {
183         return cgg.group
184 }
185
186 // Group returns the minus sign of number
187 func (cgg *cgg_UG) Minus() string {
188         return cgg.minus
189 }
190
191 // FmtNumber returns 'num' with digits/precision of 'v' for 'cgg_UG' and handles both Whole and Real numbers based on 'v'
192 func (cgg *cgg_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 'cgg_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 (cgg *cgg_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 'cgg_UG'
204 func (cgg *cgg_UG) FmtCurrency(num float64, v uint64, currency currency.Type) string {
205
206         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
207         symbol := cgg.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, cgg.decimal[0])
217                         inWhole = true
218                         continue
219                 }
220
221                 if inWhole {
222                         if count == 3 {
223                                 b = append(b, cgg.group[0])
224                                 count = 1
225                         } else {
226                                 count++
227                         }
228                 }
229
230                 b = append(b, s[i])
231         }
232
233         for j := len(symbol) - 1; j >= 0; j-- {
234                 b = append(b, symbol[j])
235         }
236
237         if num < 0 {
238                 b = append(b, cgg.minus[0])
239         }
240
241         // reverse
242         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
243                 b[i], b[j] = b[j], b[i]
244         }
245
246         if int(v) < 2 {
247
248                 if v == 0 {
249                         b = append(b, cgg.decimal...)
250                 }
251
252                 for i := 0; i < 2-int(v); i++ {
253                         b = append(b, '0')
254                 }
255         }
256
257         return string(b)
258 }
259
260 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'cgg_UG'
261 // in accounting notation.
262 func (cgg *cgg_UG) FmtAccounting(num float64, v uint64, currency currency.Type) string {
263
264         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
265         symbol := cgg.currencies[currency]
266         l := len(s) + len(symbol) + 0
267         count := 0
268         inWhole := v == 0
269         b := make([]byte, 0, l)
270
271         for i := len(s) - 1; i >= 0; i-- {
272
273                 if s[i] == '.' {
274                         b = append(b, cgg.decimal[0])
275                         inWhole = true
276                         continue
277                 }
278
279                 if inWhole {
280                         if count == 3 {
281                                 b = append(b, cgg.group[0])
282                                 count = 1
283                         } else {
284                                 count++
285                         }
286                 }
287
288                 b = append(b, s[i])
289         }
290
291         if num < 0 {
292
293                 for j := len(symbol) - 1; j >= 0; j-- {
294                         b = append(b, symbol[j])
295                 }
296
297                 b = append(b, cgg.minus[0])
298
299         } else {
300
301                 for j := len(symbol) - 1; j >= 0; j-- {
302                         b = append(b, symbol[j])
303                 }
304
305         }
306
307         // reverse
308         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
309                 b[i], b[j] = b[j], b[i]
310         }
311
312         if int(v) < 2 {
313
314                 if v == 0 {
315                         b = append(b, cgg.decimal...)
316                 }
317
318                 for i := 0; i < 2-int(v); i++ {
319                         b = append(b, '0')
320                 }
321         }
322
323         return string(b)
324 }
325
326 // FmtDateShort returns the short date representation of 't' for 'cgg_UG'
327 func (cgg *cgg_UG) FmtDateShort(t time.Time) string {
328
329         b := make([]byte, 0, 32)
330
331         if t.Day() < 10 {
332                 b = append(b, '0')
333         }
334
335         b = strconv.AppendInt(b, int64(t.Day()), 10)
336         b = append(b, []byte{0x2f}...)
337
338         if t.Month() < 10 {
339                 b = append(b, '0')
340         }
341
342         b = strconv.AppendInt(b, int64(t.Month()), 10)
343
344         b = append(b, []byte{0x2f}...)
345
346         if t.Year() > 0 {
347                 b = strconv.AppendInt(b, int64(t.Year()), 10)
348         } else {
349                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
350         }
351
352         return string(b)
353 }
354
355 // FmtDateMedium returns the medium date representation of 't' for 'cgg_UG'
356 func (cgg *cgg_UG) FmtDateMedium(t time.Time) string {
357
358         b := make([]byte, 0, 32)
359
360         b = strconv.AppendInt(b, int64(t.Day()), 10)
361         b = append(b, []byte{0x20}...)
362         b = append(b, cgg.monthsAbbreviated[t.Month()]...)
363         b = append(b, []byte{0x20}...)
364
365         if t.Year() > 0 {
366                 b = strconv.AppendInt(b, int64(t.Year()), 10)
367         } else {
368                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
369         }
370
371         return string(b)
372 }
373
374 // FmtDateLong returns the long date representation of 't' for 'cgg_UG'
375 func (cgg *cgg_UG) FmtDateLong(t time.Time) string {
376
377         b := make([]byte, 0, 32)
378
379         b = strconv.AppendInt(b, int64(t.Day()), 10)
380         b = append(b, []byte{0x20}...)
381         b = append(b, cgg.monthsWide[t.Month()]...)
382         b = append(b, []byte{0x20}...)
383
384         if t.Year() > 0 {
385                 b = strconv.AppendInt(b, int64(t.Year()), 10)
386         } else {
387                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
388         }
389
390         return string(b)
391 }
392
393 // FmtDateFull returns the full date representation of 't' for 'cgg_UG'
394 func (cgg *cgg_UG) FmtDateFull(t time.Time) string {
395
396         b := make([]byte, 0, 32)
397
398         b = append(b, cgg.daysWide[t.Weekday()]...)
399         b = append(b, []byte{0x2c, 0x20}...)
400         b = strconv.AppendInt(b, int64(t.Day()), 10)
401         b = append(b, []byte{0x20}...)
402         b = append(b, cgg.monthsWide[t.Month()]...)
403         b = append(b, []byte{0x20}...)
404
405         if t.Year() > 0 {
406                 b = strconv.AppendInt(b, int64(t.Year()), 10)
407         } else {
408                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
409         }
410
411         return string(b)
412 }
413
414 // FmtTimeShort returns the short time representation of 't' for 'cgg_UG'
415 func (cgg *cgg_UG) FmtTimeShort(t time.Time) string {
416
417         b := make([]byte, 0, 32)
418
419         if t.Hour() < 10 {
420                 b = append(b, '0')
421         }
422
423         b = strconv.AppendInt(b, int64(t.Hour()), 10)
424         b = append(b, cgg.timeSeparator...)
425
426         if t.Minute() < 10 {
427                 b = append(b, '0')
428         }
429
430         b = strconv.AppendInt(b, int64(t.Minute()), 10)
431
432         return string(b)
433 }
434
435 // FmtTimeMedium returns the medium time representation of 't' for 'cgg_UG'
436 func (cgg *cgg_UG) FmtTimeMedium(t time.Time) string {
437
438         b := make([]byte, 0, 32)
439
440         if t.Hour() < 10 {
441                 b = append(b, '0')
442         }
443
444         b = strconv.AppendInt(b, int64(t.Hour()), 10)
445         b = append(b, cgg.timeSeparator...)
446
447         if t.Minute() < 10 {
448                 b = append(b, '0')
449         }
450
451         b = strconv.AppendInt(b, int64(t.Minute()), 10)
452         b = append(b, cgg.timeSeparator...)
453
454         if t.Second() < 10 {
455                 b = append(b, '0')
456         }
457
458         b = strconv.AppendInt(b, int64(t.Second()), 10)
459
460         return string(b)
461 }
462
463 // FmtTimeLong returns the long time representation of 't' for 'cgg_UG'
464 func (cgg *cgg_UG) FmtTimeLong(t time.Time) string {
465
466         b := make([]byte, 0, 32)
467
468         if t.Hour() < 10 {
469                 b = append(b, '0')
470         }
471
472         b = strconv.AppendInt(b, int64(t.Hour()), 10)
473         b = append(b, cgg.timeSeparator...)
474
475         if t.Minute() < 10 {
476                 b = append(b, '0')
477         }
478
479         b = strconv.AppendInt(b, int64(t.Minute()), 10)
480         b = append(b, cgg.timeSeparator...)
481
482         if t.Second() < 10 {
483                 b = append(b, '0')
484         }
485
486         b = strconv.AppendInt(b, int64(t.Second()), 10)
487         b = append(b, []byte{0x20}...)
488
489         tz, _ := t.Zone()
490         b = append(b, tz...)
491
492         return string(b)
493 }
494
495 // FmtTimeFull returns the full time representation of 't' for 'cgg_UG'
496 func (cgg *cgg_UG) FmtTimeFull(t time.Time) string {
497
498         b := make([]byte, 0, 32)
499
500         if t.Hour() < 10 {
501                 b = append(b, '0')
502         }
503
504         b = strconv.AppendInt(b, int64(t.Hour()), 10)
505         b = append(b, cgg.timeSeparator...)
506
507         if t.Minute() < 10 {
508                 b = append(b, '0')
509         }
510
511         b = strconv.AppendInt(b, int64(t.Minute()), 10)
512         b = append(b, cgg.timeSeparator...)
513
514         if t.Second() < 10 {
515                 b = append(b, '0')
516         }
517
518         b = strconv.AppendInt(b, int64(t.Second()), 10)
519         b = append(b, []byte{0x20}...)
520
521         tz, _ := t.Zone()
522
523         if btz, ok := cgg.timezones[tz]; ok {
524                 b = append(b, btz...)
525         } else {
526                 b = append(b, tz...)
527         }
528
529         return string(b)
530 }