OSDN Git Service

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