OSDN Git Service

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