OSDN Git Service

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