OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ce_RU / ce_RU.go
1 package ce_RU
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 ce_RU 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         percentSuffix          string
22         perMille               string
23         timeSeparator          string
24         inifinity              string
25         currencies             []string // idx = enum of currency code
26         currencyPositiveSuffix string
27         currencyNegativeSuffix string
28         monthsAbbreviated      []string
29         monthsNarrow           []string
30         monthsWide             []string
31         daysAbbreviated        []string
32         daysNarrow             []string
33         daysShort              []string
34         daysWide               []string
35         periodsAbbreviated     []string
36         periodsNarrow          []string
37         periodsShort           []string
38         periodsWide            []string
39         erasAbbreviated        []string
40         erasNarrow             []string
41         erasWide               []string
42         timezones              map[string]string
43 }
44
45 // New returns a new instance of translator for the 'ce_RU' locale
46 func New() locales.Translator {
47         return &ce_RU{
48                 locale:                 "ce_RU",
49                 pluralsCardinal:        []locales.PluralRule{2, 6},
50                 pluralsOrdinal:         []locales.PluralRule{6},
51                 pluralsRange:           nil,
52                 decimal:                ".",
53                 group:                  ",",
54                 minus:                  "-",
55                 percent:                "%",
56                 perMille:               "‰",
57                 timeSeparator:          ":",
58                 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"},
59                 percentSuffix:          " ",
60                 currencyPositiveSuffix: " ",
61                 currencyNegativeSuffix: " ",
62                 monthsAbbreviated:      []string{"", "янв", "фев", "мар", "апр", "май", "июн", "июл", "авг", "сен", "окт", "ноя", "дек"},
63                 monthsWide:             []string{"", "январь", "февраль", "март", "апрель", "май", "июнь", "июль", "август", "сентябрь", "октябрь", "ноябрь", "декабрь"},
64                 daysWide:               []string{"кӀиранан де", "оршотан де", "шинарин де", "кхаарин де", "еарин де", "пӀераскан де", "шот де"},
65                 timezones:              map[string]string{"WART": "Малхбузен Аргентина, стандартан хан", "MDT": "Лаьмнийн аьхкенан хан (АЦШ)", "PDT": "Тийна океанан аьхкенан хан", "CHAST": "Чатем, стандартан хан", "MESZ": "Юккъера Европа, аьхкенан хан", "HAST": "Гавайн-алеутийн стандартан хан", "HENOMX": "Къилбаседа Американ Мексикан аьхкенан хан", "LHST": "Лорд-Хау, стандартан хан", "AEST": "Малхбален Австрали, стандартан хан", "WEZ": "Малхбузен Европа, стандартан хан", "HEPM": "Сен-Пьер а, Микелон а, аьхкенан хан", "CHADT": "Чатем, аьхкенан хан", "AWST": "Малхбузен Австрали, стандартан хан", "HEOG": "Малхбузен Гренланди, аьхкенан хан", "WAST": "Малхбузен Африка, аьхкенан хан", "CLT": "Чили, стандартан хан", "HNEG": "Малхбален Гренланди, стандартан хан", "COST": "Колумби, аьхкенан хан", "HAT": "Ньюфаундленд, аьхкенан хан", "HKT": "Гонконг, стандартан хан", "WARST": "Малхбузен Аргентина, аьхкенан хан", "WITA": "Юккъера Индонези", "HEEG": "Малхбален Гренланди, аьхкенан хан", "COT": "Колумби, стандартан хан", "CLST": "Чили, аьхкенан хан", "TMT": "Туркменин стандартан хан", "AST": "Атлантикан стандартан хан", "HEPMX": "Тийна океанан Мексикан аьхкенан хан", "HNPM": "Сен-Пьер а, Микелон а, стандартан хан", "WIT": "Малхбален Индонези", "EDT": "Малхбален Америка, аьхкенан хан", "AKDT": "Аляска, аьхкенан хан", "ChST": "Чаморро", "NZDT": "Керла Зеланди, аьхкенан хан", "VET": "Венесуэла", "JDT": "Япони, аьхкенан хан", "OEZ": "Малхбален Европа, стандартан хан", "ART": "Аргентина, стандартан хан", "EAT": "Малхбален Африка", "SGT": "Сингапур", "WIB": "Малхбузен Индонези", "LHDT": "Лорд-Хау, аьхкенан хан", "HNOG": "Малхбузен Гренланди, стандартан хан", "SAST": "Къилба Африка", "NZST": "Керла Зеланди, стандартан хан", "ACWDT": "Юккъера Австрали, малхбузен аьхкенан хан", "HNNOMX": "Къилбаседа Американ Мексикан стандартан хан", "JST": "Япони, стандартан хан", "WAT": "Малхбузен Африка, стандартан хан", "HKST": "Гонконг, аьхкенан хан", "ECT": "Эквадор", "SRT": "Суринам", "CST": "Юккъера Америка, стандартан хан", "OESZ": "Малхбален Европа, аьхкенан хан", "MST": "Лаьмнийн стандартан хан (АЦШ)", "IST": "Инди", "MYT": "Малайзи", "GFT": "Французийн Гвиана", "GYT": "Гайана", "CAT": "Юккъера Африка", "HNPMX": "Тийна океанан Мексикан стандартан хан", "BT": "Бутан", "CDT": "Юккъера Америка, аьхкенан хан", "ACWST": "Юккъера Австрали, малхбузен стандартан хан", "TMST": "Туркменин аьхкенан хан", "∅∅∅": "Азоран гӀайренаш, аьхкенан хан", "ARST": "Аргентина, аьхкенан хан", "EST": "Малхбален Америка, стандартан хан", "AKST": "Аляска, стандартан хан", "ACDT": "Юккъера Австрали, аьхкенан хан", "MEZ": "Юккъера Европа, стандартан хан", "ADT": "Атлантикан аьхкенан хан", "HNT": "Ньюфаундленд, стандартан хан", "UYT": "Уругвай, стандартан хан", "AEDT": "Малхбален Австрали, аьхкенан хан", "WESZ": "Малхбузен Европа, аьхкенан хан", "GMT": "Гринвичица юкъара хан", "HECU": "Куба, аьхкенан хан", "BOT": "Боливи", "HADT": "Гавайн-алеутийн аьхкенан хан", "ACST": "Юккъера Австрали, стандартан хан", "PST": "Тийна океанан стандартан хан", "HNCU": "Куба, стандартан хан", "AWDT": "Малхбузен Австрали, аьхкенан хан", "UYST": "Уругвай, аьхкенан хан"},
66         }
67 }
68
69 // Locale returns the current translators string locale
70 func (ce *ce_RU) Locale() string {
71         return ce.locale
72 }
73
74 // PluralsCardinal returns the list of cardinal plural rules associated with 'ce_RU'
75 func (ce *ce_RU) PluralsCardinal() []locales.PluralRule {
76         return ce.pluralsCardinal
77 }
78
79 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ce_RU'
80 func (ce *ce_RU) PluralsOrdinal() []locales.PluralRule {
81         return ce.pluralsOrdinal
82 }
83
84 // PluralsRange returns the list of range plural rules associated with 'ce_RU'
85 func (ce *ce_RU) PluralsRange() []locales.PluralRule {
86         return ce.pluralsRange
87 }
88
89 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ce_RU'
90 func (ce *ce_RU) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
91
92         n := math.Abs(num)
93
94         if n == 1 {
95                 return locales.PluralRuleOne
96         }
97
98         return locales.PluralRuleOther
99 }
100
101 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ce_RU'
102 func (ce *ce_RU) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
103         return locales.PluralRuleOther
104 }
105
106 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ce_RU'
107 func (ce *ce_RU) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
108         return locales.PluralRuleUnknown
109 }
110
111 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
112 func (ce *ce_RU) MonthAbbreviated(month time.Month) string {
113         return ce.monthsAbbreviated[month]
114 }
115
116 // MonthsAbbreviated returns the locales abbreviated months
117 func (ce *ce_RU) MonthsAbbreviated() []string {
118         return ce.monthsAbbreviated[1:]
119 }
120
121 // MonthNarrow returns the locales narrow month given the 'month' provided
122 func (ce *ce_RU) MonthNarrow(month time.Month) string {
123         return ce.monthsNarrow[month]
124 }
125
126 // MonthsNarrow returns the locales narrow months
127 func (ce *ce_RU) MonthsNarrow() []string {
128         return nil
129 }
130
131 // MonthWide returns the locales wide month given the 'month' provided
132 func (ce *ce_RU) MonthWide(month time.Month) string {
133         return ce.monthsWide[month]
134 }
135
136 // MonthsWide returns the locales wide months
137 func (ce *ce_RU) MonthsWide() []string {
138         return ce.monthsWide[1:]
139 }
140
141 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
142 func (ce *ce_RU) WeekdayAbbreviated(weekday time.Weekday) string {
143         return ce.daysAbbreviated[weekday]
144 }
145
146 // WeekdaysAbbreviated returns the locales abbreviated weekdays
147 func (ce *ce_RU) WeekdaysAbbreviated() []string {
148         return ce.daysAbbreviated
149 }
150
151 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
152 func (ce *ce_RU) WeekdayNarrow(weekday time.Weekday) string {
153         return ce.daysNarrow[weekday]
154 }
155
156 // WeekdaysNarrow returns the locales narrow weekdays
157 func (ce *ce_RU) WeekdaysNarrow() []string {
158         return ce.daysNarrow
159 }
160
161 // WeekdayShort returns the locales short weekday given the 'weekday' provided
162 func (ce *ce_RU) WeekdayShort(weekday time.Weekday) string {
163         return ce.daysShort[weekday]
164 }
165
166 // WeekdaysShort returns the locales short weekdays
167 func (ce *ce_RU) WeekdaysShort() []string {
168         return ce.daysShort
169 }
170
171 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
172 func (ce *ce_RU) WeekdayWide(weekday time.Weekday) string {
173         return ce.daysWide[weekday]
174 }
175
176 // WeekdaysWide returns the locales wide weekdays
177 func (ce *ce_RU) WeekdaysWide() []string {
178         return ce.daysWide
179 }
180
181 // Decimal returns the decimal point of number
182 func (ce *ce_RU) Decimal() string {
183         return ce.decimal
184 }
185
186 // Group returns the group of number
187 func (ce *ce_RU) Group() string {
188         return ce.group
189 }
190
191 // Group returns the minus sign of number
192 func (ce *ce_RU) Minus() string {
193         return ce.minus
194 }
195
196 // FmtNumber returns 'num' with digits/precision of 'v' for 'ce_RU' and handles both Whole and Real numbers based on 'v'
197 func (ce *ce_RU) FmtNumber(num float64, v uint64) string {
198
199         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
200         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
201         count := 0
202         inWhole := v == 0
203         b := make([]byte, 0, l)
204
205         for i := len(s) - 1; i >= 0; i-- {
206
207                 if s[i] == '.' {
208                         b = append(b, ce.decimal[0])
209                         inWhole = true
210                         continue
211                 }
212
213                 if inWhole {
214                         if count == 3 {
215                                 b = append(b, ce.group[0])
216                                 count = 1
217                         } else {
218                                 count++
219                         }
220                 }
221
222                 b = append(b, s[i])
223         }
224
225         if num < 0 {
226                 b = append(b, ce.minus[0])
227         }
228
229         // reverse
230         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
231                 b[i], b[j] = b[j], b[i]
232         }
233
234         return string(b)
235 }
236
237 // FmtPercent returns 'num' with digits/precision of 'v' for 'ce_RU' and handles both Whole and Real numbers based on 'v'
238 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
239 func (ce *ce_RU) FmtPercent(num float64, v uint64) string {
240         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
241         l := len(s) + 5
242         b := make([]byte, 0, l)
243
244         for i := len(s) - 1; i >= 0; i-- {
245
246                 if s[i] == '.' {
247                         b = append(b, ce.decimal[0])
248                         continue
249                 }
250
251                 b = append(b, s[i])
252         }
253
254         if num < 0 {
255                 b = append(b, ce.minus[0])
256         }
257
258         // reverse
259         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
260                 b[i], b[j] = b[j], b[i]
261         }
262
263         b = append(b, ce.percentSuffix...)
264
265         b = append(b, ce.percent...)
266
267         return string(b)
268 }
269
270 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ce_RU'
271 func (ce *ce_RU) FmtCurrency(num float64, v uint64, currency currency.Type) string {
272
273         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
274         symbol := ce.currencies[currency]
275         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
276         count := 0
277         inWhole := v == 0
278         b := make([]byte, 0, l)
279
280         for i := len(s) - 1; i >= 0; i-- {
281
282                 if s[i] == '.' {
283                         b = append(b, ce.decimal[0])
284                         inWhole = true
285                         continue
286                 }
287
288                 if inWhole {
289                         if count == 3 {
290                                 b = append(b, ce.group[0])
291                                 count = 1
292                         } else {
293                                 count++
294                         }
295                 }
296
297                 b = append(b, s[i])
298         }
299
300         if num < 0 {
301                 b = append(b, ce.minus[0])
302         }
303
304         // reverse
305         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
306                 b[i], b[j] = b[j], b[i]
307         }
308
309         if int(v) < 2 {
310
311                 if v == 0 {
312                         b = append(b, ce.decimal...)
313                 }
314
315                 for i := 0; i < 2-int(v); i++ {
316                         b = append(b, '0')
317                 }
318         }
319
320         b = append(b, ce.currencyPositiveSuffix...)
321
322         b = append(b, symbol...)
323
324         return string(b)
325 }
326
327 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ce_RU'
328 // in accounting notation.
329 func (ce *ce_RU) FmtAccounting(num float64, v uint64, currency currency.Type) string {
330
331         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
332         symbol := ce.currencies[currency]
333         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
334         count := 0
335         inWhole := v == 0
336         b := make([]byte, 0, l)
337
338         for i := len(s) - 1; i >= 0; i-- {
339
340                 if s[i] == '.' {
341                         b = append(b, ce.decimal[0])
342                         inWhole = true
343                         continue
344                 }
345
346                 if inWhole {
347                         if count == 3 {
348                                 b = append(b, ce.group[0])
349                                 count = 1
350                         } else {
351                                 count++
352                         }
353                 }
354
355                 b = append(b, s[i])
356         }
357
358         if num < 0 {
359
360                 b = append(b, ce.minus[0])
361
362         }
363
364         // reverse
365         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
366                 b[i], b[j] = b[j], b[i]
367         }
368
369         if int(v) < 2 {
370
371                 if v == 0 {
372                         b = append(b, ce.decimal...)
373                 }
374
375                 for i := 0; i < 2-int(v); i++ {
376                         b = append(b, '0')
377                 }
378         }
379
380         if num < 0 {
381                 b = append(b, ce.currencyNegativeSuffix...)
382                 b = append(b, symbol...)
383         } else {
384
385                 b = append(b, ce.currencyPositiveSuffix...)
386                 b = append(b, symbol...)
387         }
388
389         return string(b)
390 }
391
392 // FmtDateShort returns the short date representation of 't' for 'ce_RU'
393 func (ce *ce_RU) FmtDateShort(t time.Time) string {
394
395         b := make([]byte, 0, 32)
396
397         return string(b)
398 }
399
400 // FmtDateMedium returns the medium date representation of 't' for 'ce_RU'
401 func (ce *ce_RU) FmtDateMedium(t time.Time) string {
402
403         b := make([]byte, 0, 32)
404
405         return string(b)
406 }
407
408 // FmtDateLong returns the long date representation of 't' for 'ce_RU'
409 func (ce *ce_RU) FmtDateLong(t time.Time) string {
410
411         b := make([]byte, 0, 32)
412
413         return string(b)
414 }
415
416 // FmtDateFull returns the full date representation of 't' for 'ce_RU'
417 func (ce *ce_RU) FmtDateFull(t time.Time) string {
418
419         b := make([]byte, 0, 32)
420
421         return string(b)
422 }
423
424 // FmtTimeShort returns the short time representation of 't' for 'ce_RU'
425 func (ce *ce_RU) FmtTimeShort(t time.Time) string {
426
427         b := make([]byte, 0, 32)
428
429         return string(b)
430 }
431
432 // FmtTimeMedium returns the medium time representation of 't' for 'ce_RU'
433 func (ce *ce_RU) FmtTimeMedium(t time.Time) string {
434
435         b := make([]byte, 0, 32)
436
437         return string(b)
438 }
439
440 // FmtTimeLong returns the long time representation of 't' for 'ce_RU'
441 func (ce *ce_RU) FmtTimeLong(t time.Time) string {
442
443         b := make([]byte, 0, 32)
444
445         return string(b)
446 }
447
448 // FmtTimeFull returns the full time representation of 't' for 'ce_RU'
449 func (ce *ce_RU) FmtTimeFull(t time.Time) string {
450
451         b := make([]byte, 0, 32)
452
453         return string(b)
454 }