OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / ru_BY / ru_BY.go
1 package ru_BY
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 ru_BY 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 'ru_BY' locale
45 func New() locales.Translator {
46         return &ru_BY{
47                 locale:                 "ru_BY",
48                 pluralsCardinal:        []locales.PluralRule{2, 4, 5, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{2, 4, 5, 6},
51                 decimal:                ",",
52                 group:                  " ",
53                 minus:                  "-",
54                 percent:                "%",
55                 perMille:               "‰",
56                 timeSeparator:          ":",
57                 inifinity:              "∞",
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", "Br", "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                 currencyPositiveSuffix: " ",
60                 currencyNegativeSuffix: " ",
61                 monthsAbbreviated:      []string{"", "янв.", "февр.", "мар.", "апр.", "мая", "июн.", "июл.", "авг.", "сент.", "окт.", "нояб.", "дек."},
62                 monthsNarrow:           []string{"", "Я", "Ф", "М", "А", "М", "И", "И", "А", "С", "О", "Н", "Д"},
63                 monthsWide:             []string{"", "января", "февраля", "марта", "апреля", "мая", "июня", "июля", "августа", "сентября", "октября", "ноября", "декабря"},
64                 daysAbbreviated:        []string{"вс", "пн", "вт", "ср", "чт", "пт", "сб"},
65                 daysNarrow:             []string{"вс", "пн", "вт", "ср", "чт", "пт", "сб"},
66                 daysShort:              []string{"вс", "пн", "вт", "ср", "чт", "пт", "сб"},
67                 daysWide:               []string{"воскресенье", "понедельник", "вторник", "среда", "четверг", "пятница", "суббота"},
68                 periodsAbbreviated:     []string{"ДП", "ПП"},
69                 periodsNarrow:          []string{"ДП", "ПП"},
70                 periodsWide:            []string{"ДП", "ПП"},
71                 erasAbbreviated:        []string{"до н. э.", "н. э."},
72                 erasNarrow:             []string{"до н.э.", "н.э."},
73                 erasWide:               []string{"до Рождества Христова", "от Рождества Христова"},
74                 timezones:              map[string]string{"HKST": "Гонконг, летнее время", "AKST": "Аляска, стандартное время", "PDT": "Тихоокеанское летнее время", "HNCU": "Куба, стандартное время", "CDT": "Центральная Америка, летнее время", "MEZ": "Центральная Европа, стандартное время", "MESZ": "Центральная Европа, летнее время", "HEOG": "Западная Гренландия, летнее время", "SAST": "Южная Африка", "ChST": "Чаморро", "MYT": "Малайзия", "WEZ": "Западная Европа, стандартное время", "SGT": "Сингапур", "MDT": "Макао, летнее время", "AWST": "Западная Австралия, стандартное время", "HENOMX": "Северо-западное мексиканское летнее время", "HNEG": "Восточная Гренландия, стандарное время", "ECT": "Эквадор", "CHADT": "Чатем, летнее время", "LHDT": "Лорд-Хау, летнее время", "CLST": "Чили, летнее время", "CAT": "Центральная Африка", "PST": "Тихоокеанское стандартное время", "HEPM": "Сен-Пьер и Микелон, летнее время", "HAST": "Гавайско-алеутское стандартное время", "NZST": "Новая Зеландия, стандартное время", "ARST": "Аргентина, летнее время", "HNOG": "Западная Гренландия, стандартное время", "EAT": "Восточная Африка", "NZDT": "Новая Зеландия, летнее время", "HNNOMX": "Северо-западное мексиканское стандартное время", "COT": "Колумбия, стандартное время", "HEPMX": "Тихоокеанское мексиканское летнее время", "BT": "Бутан", "AWDT": "Западная Австралия, летнее время", "WARST": "Западная Аргентина, летнее время", "WAST": "Западная Африка, летнее время", "HEEG": "Восточная Гренландия, летнее время", "HAT": "Ньюфаундленд, летнее время", "CLT": "Чили, стандартное время", "EDT": "Восточная Америка, летнее время", "GMT": "Среднее время по Гринвичу", "GFT": "Французская Гвиана", "AKDT": "Аляска, летнее время", "ACST": "Центральная Австралия, стандартное время", "UYST": "Уругвай, летнее время", "LHST": "Лорд-Хау, стандартное время", "ACDT": "Центральная Австралия, летнее время", "WESZ": "Западная Европа, летнее время", "HNPMX": "Тихоокеанское мексиканское стандартное время", "ACWDT": "Центральная Австралия, западное летнее время", "TMT": "Туркмения, стандартное время", "TMST": "Туркмения, летнее время", "OEZ": "Восточная Европа, стандартное время", "WART": "Западная Аргентина, стандартное время", "JDT": "Япония, летнее время", "IST": "Индия", "ART": "Аргентина, стандартное время", "WIT": "Восточная Индонезия", "JST": "Япония, стандартное время", "ADT": "Атлантическое летнее время", "WAT": "Западная Африка, стандартное время", "WITA": "Центральная Индонезия", "BOT": "Боливия", "ACWST": "Центральная Австралия, западное стандартное время", "AST": "Атлантическое стандартное время", "HKT": "Гонконг, стандартное время", "HECU": "Куба, летнее время", "HNPM": "Сен-Пьер и Микелон, стандартное время", "CST": "Центральная Америка, стандартное время", "MST": "Макао, стандартное время", "UYT": "Уругвай, стандартное время", "OESZ": "Восточная Европа, летнее время", "VET": "Венесуэла", "HNT": "Ньюфаундленд, стандартное время", "COST": "Колумбия, летнее время", "GYT": "Гайана", "WIB": "Западная Индонезия", "CHAST": "Чатем, стандартное время", "AEDT": "Восточная Австралия, летнее время", "EST": "Восточная Америка, стандартное время", "∅∅∅": "Амазонка, летнее время", "SRT": "Суринам", "HADT": "Гавайско-алеутское летнее время", "AEST": "Восточная Австралия, стандартное время"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (ru *ru_BY) Locale() string {
80         return ru.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'ru_BY'
84 func (ru *ru_BY) PluralsCardinal() []locales.PluralRule {
85         return ru.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'ru_BY'
89 func (ru *ru_BY) PluralsOrdinal() []locales.PluralRule {
90         return ru.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'ru_BY'
94 func (ru *ru_BY) PluralsRange() []locales.PluralRule {
95         return ru.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'ru_BY'
99 func (ru *ru_BY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103         iMod10 := i % 10
104         iMod100 := i % 100
105
106         if v == 0 && iMod10 == 1 && iMod100 != 11 {
107                 return locales.PluralRuleOne
108         } else if v == 0 && iMod10 >= 2 && iMod10 <= 4 && (iMod100 < 12 || iMod100 > 14) {
109                 return locales.PluralRuleFew
110         } else if (v == 0 && iMod10 == 0) || (v == 0 && iMod10 >= 5 && iMod10 <= 9) || (v == 0 && iMod100 >= 11 && iMod100 <= 14) {
111                 return locales.PluralRuleMany
112         }
113
114         return locales.PluralRuleOther
115 }
116
117 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'ru_BY'
118 func (ru *ru_BY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
119         return locales.PluralRuleOther
120 }
121
122 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'ru_BY'
123 func (ru *ru_BY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
124
125         start := ru.CardinalPluralRule(num1, v1)
126         end := ru.CardinalPluralRule(num2, v2)
127
128         if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
129                 return locales.PluralRuleOne
130         } else if start == locales.PluralRuleOne && end == locales.PluralRuleFew {
131                 return locales.PluralRuleFew
132         } else if start == locales.PluralRuleOne && end == locales.PluralRuleMany {
133                 return locales.PluralRuleMany
134         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
135                 return locales.PluralRuleOther
136         } else if start == locales.PluralRuleFew && end == locales.PluralRuleOne {
137                 return locales.PluralRuleOne
138         } else if start == locales.PluralRuleFew && end == locales.PluralRuleFew {
139                 return locales.PluralRuleFew
140         } else if start == locales.PluralRuleFew && end == locales.PluralRuleMany {
141                 return locales.PluralRuleMany
142         } else if start == locales.PluralRuleFew && end == locales.PluralRuleOther {
143                 return locales.PluralRuleOther
144         } else if start == locales.PluralRuleMany && end == locales.PluralRuleOne {
145                 return locales.PluralRuleOne
146         } else if start == locales.PluralRuleMany && end == locales.PluralRuleFew {
147                 return locales.PluralRuleFew
148         } else if start == locales.PluralRuleMany && end == locales.PluralRuleMany {
149                 return locales.PluralRuleMany
150         } else if start == locales.PluralRuleMany && end == locales.PluralRuleOther {
151                 return locales.PluralRuleOther
152         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
153                 return locales.PluralRuleOne
154         } else if start == locales.PluralRuleOther && end == locales.PluralRuleFew {
155                 return locales.PluralRuleFew
156         } else if start == locales.PluralRuleOther && end == locales.PluralRuleMany {
157                 return locales.PluralRuleMany
158         }
159
160         return locales.PluralRuleOther
161
162 }
163
164 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
165 func (ru *ru_BY) MonthAbbreviated(month time.Month) string {
166         return ru.monthsAbbreviated[month]
167 }
168
169 // MonthsAbbreviated returns the locales abbreviated months
170 func (ru *ru_BY) MonthsAbbreviated() []string {
171         return ru.monthsAbbreviated[1:]
172 }
173
174 // MonthNarrow returns the locales narrow month given the 'month' provided
175 func (ru *ru_BY) MonthNarrow(month time.Month) string {
176         return ru.monthsNarrow[month]
177 }
178
179 // MonthsNarrow returns the locales narrow months
180 func (ru *ru_BY) MonthsNarrow() []string {
181         return ru.monthsNarrow[1:]
182 }
183
184 // MonthWide returns the locales wide month given the 'month' provided
185 func (ru *ru_BY) MonthWide(month time.Month) string {
186         return ru.monthsWide[month]
187 }
188
189 // MonthsWide returns the locales wide months
190 func (ru *ru_BY) MonthsWide() []string {
191         return ru.monthsWide[1:]
192 }
193
194 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
195 func (ru *ru_BY) WeekdayAbbreviated(weekday time.Weekday) string {
196         return ru.daysAbbreviated[weekday]
197 }
198
199 // WeekdaysAbbreviated returns the locales abbreviated weekdays
200 func (ru *ru_BY) WeekdaysAbbreviated() []string {
201         return ru.daysAbbreviated
202 }
203
204 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
205 func (ru *ru_BY) WeekdayNarrow(weekday time.Weekday) string {
206         return ru.daysNarrow[weekday]
207 }
208
209 // WeekdaysNarrow returns the locales narrow weekdays
210 func (ru *ru_BY) WeekdaysNarrow() []string {
211         return ru.daysNarrow
212 }
213
214 // WeekdayShort returns the locales short weekday given the 'weekday' provided
215 func (ru *ru_BY) WeekdayShort(weekday time.Weekday) string {
216         return ru.daysShort[weekday]
217 }
218
219 // WeekdaysShort returns the locales short weekdays
220 func (ru *ru_BY) WeekdaysShort() []string {
221         return ru.daysShort
222 }
223
224 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
225 func (ru *ru_BY) WeekdayWide(weekday time.Weekday) string {
226         return ru.daysWide[weekday]
227 }
228
229 // WeekdaysWide returns the locales wide weekdays
230 func (ru *ru_BY) WeekdaysWide() []string {
231         return ru.daysWide
232 }
233
234 // Decimal returns the decimal point of number
235 func (ru *ru_BY) Decimal() string {
236         return ru.decimal
237 }
238
239 // Group returns the group of number
240 func (ru *ru_BY) Group() string {
241         return ru.group
242 }
243
244 // Group returns the minus sign of number
245 func (ru *ru_BY) Minus() string {
246         return ru.minus
247 }
248
249 // FmtNumber returns 'num' with digits/precision of 'v' for 'ru_BY' and handles both Whole and Real numbers based on 'v'
250 func (ru *ru_BY) FmtNumber(num float64, v uint64) string {
251
252         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
253         l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
254         count := 0
255         inWhole := v == 0
256         b := make([]byte, 0, l)
257
258         for i := len(s) - 1; i >= 0; i-- {
259
260                 if s[i] == '.' {
261                         b = append(b, ru.decimal[0])
262                         inWhole = true
263                         continue
264                 }
265
266                 if inWhole {
267                         if count == 3 {
268                                 for j := len(ru.group) - 1; j >= 0; j-- {
269                                         b = append(b, ru.group[j])
270                                 }
271                                 count = 1
272                         } else {
273                                 count++
274                         }
275                 }
276
277                 b = append(b, s[i])
278         }
279
280         if num < 0 {
281                 b = append(b, ru.minus[0])
282         }
283
284         // reverse
285         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
286                 b[i], b[j] = b[j], b[i]
287         }
288
289         return string(b)
290 }
291
292 // FmtPercent returns 'num' with digits/precision of 'v' for 'ru_BY' and handles both Whole and Real numbers based on 'v'
293 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
294 func (ru *ru_BY) FmtPercent(num float64, v uint64) string {
295         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
296         l := len(s) + 3
297         b := make([]byte, 0, l)
298
299         for i := len(s) - 1; i >= 0; i-- {
300
301                 if s[i] == '.' {
302                         b = append(b, ru.decimal[0])
303                         continue
304                 }
305
306                 b = append(b, s[i])
307         }
308
309         if num < 0 {
310                 b = append(b, ru.minus[0])
311         }
312
313         // reverse
314         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
315                 b[i], b[j] = b[j], b[i]
316         }
317
318         b = append(b, ru.percent...)
319
320         return string(b)
321 }
322
323 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'ru_BY'
324 func (ru *ru_BY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
325
326         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
327         symbol := ru.currencies[currency]
328         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
329         count := 0
330         inWhole := v == 0
331         b := make([]byte, 0, l)
332
333         for i := len(s) - 1; i >= 0; i-- {
334
335                 if s[i] == '.' {
336                         b = append(b, ru.decimal[0])
337                         inWhole = true
338                         continue
339                 }
340
341                 if inWhole {
342                         if count == 3 {
343                                 for j := len(ru.group) - 1; j >= 0; j-- {
344                                         b = append(b, ru.group[j])
345                                 }
346                                 count = 1
347                         } else {
348                                 count++
349                         }
350                 }
351
352                 b = append(b, s[i])
353         }
354
355         if num < 0 {
356                 b = append(b, ru.minus[0])
357         }
358
359         // reverse
360         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
361                 b[i], b[j] = b[j], b[i]
362         }
363
364         if int(v) < 2 {
365
366                 if v == 0 {
367                         b = append(b, ru.decimal...)
368                 }
369
370                 for i := 0; i < 2-int(v); i++ {
371                         b = append(b, '0')
372                 }
373         }
374
375         b = append(b, ru.currencyPositiveSuffix...)
376
377         b = append(b, symbol...)
378
379         return string(b)
380 }
381
382 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'ru_BY'
383 // in accounting notation.
384 func (ru *ru_BY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
385
386         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
387         symbol := ru.currencies[currency]
388         l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
389         count := 0
390         inWhole := v == 0
391         b := make([]byte, 0, l)
392
393         for i := len(s) - 1; i >= 0; i-- {
394
395                 if s[i] == '.' {
396                         b = append(b, ru.decimal[0])
397                         inWhole = true
398                         continue
399                 }
400
401                 if inWhole {
402                         if count == 3 {
403                                 for j := len(ru.group) - 1; j >= 0; j-- {
404                                         b = append(b, ru.group[j])
405                                 }
406                                 count = 1
407                         } else {
408                                 count++
409                         }
410                 }
411
412                 b = append(b, s[i])
413         }
414
415         if num < 0 {
416
417                 b = append(b, ru.minus[0])
418
419         }
420
421         // reverse
422         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
423                 b[i], b[j] = b[j], b[i]
424         }
425
426         if int(v) < 2 {
427
428                 if v == 0 {
429                         b = append(b, ru.decimal...)
430                 }
431
432                 for i := 0; i < 2-int(v); i++ {
433                         b = append(b, '0')
434                 }
435         }
436
437         if num < 0 {
438                 b = append(b, ru.currencyNegativeSuffix...)
439                 b = append(b, symbol...)
440         } else {
441
442                 b = append(b, ru.currencyPositiveSuffix...)
443                 b = append(b, symbol...)
444         }
445
446         return string(b)
447 }
448
449 // FmtDateShort returns the short date representation of 't' for 'ru_BY'
450 func (ru *ru_BY) FmtDateShort(t time.Time) string {
451
452         b := make([]byte, 0, 32)
453
454         if t.Day() < 10 {
455                 b = append(b, '0')
456         }
457
458         b = strconv.AppendInt(b, int64(t.Day()), 10)
459         b = append(b, []byte{0x2e}...)
460
461         if t.Month() < 10 {
462                 b = append(b, '0')
463         }
464
465         b = strconv.AppendInt(b, int64(t.Month()), 10)
466
467         b = append(b, []byte{0x2e}...)
468
469         if t.Year() > 0 {
470                 b = strconv.AppendInt(b, int64(t.Year()), 10)
471         } else {
472                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
473         }
474
475         return string(b)
476 }
477
478 // FmtDateMedium returns the medium date representation of 't' for 'ru_BY'
479 func (ru *ru_BY) FmtDateMedium(t time.Time) string {
480
481         b := make([]byte, 0, 32)
482
483         b = strconv.AppendInt(b, int64(t.Day()), 10)
484         b = append(b, []byte{0x20}...)
485         b = append(b, ru.monthsAbbreviated[t.Month()]...)
486         b = append(b, []byte{0x20}...)
487
488         if t.Year() > 0 {
489                 b = strconv.AppendInt(b, int64(t.Year()), 10)
490         } else {
491                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
492         }
493
494         b = append(b, []byte{0x20, 0xd0, 0xb3}...)
495         b = append(b, []byte{0x2e}...)
496
497         return string(b)
498 }
499
500 // FmtDateLong returns the long date representation of 't' for 'ru_BY'
501 func (ru *ru_BY) FmtDateLong(t time.Time) string {
502
503         b := make([]byte, 0, 32)
504
505         b = strconv.AppendInt(b, int64(t.Day()), 10)
506         b = append(b, []byte{0x20}...)
507         b = append(b, ru.monthsWide[t.Month()]...)
508         b = append(b, []byte{0x20}...)
509
510         if t.Year() > 0 {
511                 b = strconv.AppendInt(b, int64(t.Year()), 10)
512         } else {
513                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
514         }
515
516         b = append(b, []byte{0x20, 0xd0, 0xb3}...)
517         b = append(b, []byte{0x2e}...)
518
519         return string(b)
520 }
521
522 // FmtDateFull returns the full date representation of 't' for 'ru_BY'
523 func (ru *ru_BY) FmtDateFull(t time.Time) string {
524
525         b := make([]byte, 0, 32)
526
527         b = append(b, ru.daysWide[t.Weekday()]...)
528         b = append(b, []byte{0x2c, 0x20}...)
529         b = strconv.AppendInt(b, int64(t.Day()), 10)
530         b = append(b, []byte{0x20}...)
531         b = append(b, ru.monthsWide[t.Month()]...)
532         b = append(b, []byte{0x20}...)
533
534         if t.Year() > 0 {
535                 b = strconv.AppendInt(b, int64(t.Year()), 10)
536         } else {
537                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
538         }
539
540         b = append(b, []byte{0x20, 0xd0, 0xb3}...)
541         b = append(b, []byte{0x2e}...)
542
543         return string(b)
544 }
545
546 // FmtTimeShort returns the short time representation of 't' for 'ru_BY'
547 func (ru *ru_BY) FmtTimeShort(t time.Time) string {
548
549         b := make([]byte, 0, 32)
550
551         b = strconv.AppendInt(b, int64(t.Hour()), 10)
552         b = append(b, ru.timeSeparator...)
553
554         if t.Minute() < 10 {
555                 b = append(b, '0')
556         }
557
558         b = strconv.AppendInt(b, int64(t.Minute()), 10)
559
560         return string(b)
561 }
562
563 // FmtTimeMedium returns the medium time representation of 't' for 'ru_BY'
564 func (ru *ru_BY) FmtTimeMedium(t time.Time) string {
565
566         b := make([]byte, 0, 32)
567
568         b = strconv.AppendInt(b, int64(t.Hour()), 10)
569         b = append(b, ru.timeSeparator...)
570
571         if t.Minute() < 10 {
572                 b = append(b, '0')
573         }
574
575         b = strconv.AppendInt(b, int64(t.Minute()), 10)
576         b = append(b, ru.timeSeparator...)
577
578         if t.Second() < 10 {
579                 b = append(b, '0')
580         }
581
582         b = strconv.AppendInt(b, int64(t.Second()), 10)
583
584         return string(b)
585 }
586
587 // FmtTimeLong returns the long time representation of 't' for 'ru_BY'
588 func (ru *ru_BY) FmtTimeLong(t time.Time) string {
589
590         b := make([]byte, 0, 32)
591
592         b = strconv.AppendInt(b, int64(t.Hour()), 10)
593         b = append(b, ru.timeSeparator...)
594
595         if t.Minute() < 10 {
596                 b = append(b, '0')
597         }
598
599         b = strconv.AppendInt(b, int64(t.Minute()), 10)
600         b = append(b, ru.timeSeparator...)
601
602         if t.Second() < 10 {
603                 b = append(b, '0')
604         }
605
606         b = strconv.AppendInt(b, int64(t.Second()), 10)
607         b = append(b, []byte{0x20}...)
608
609         tz, _ := t.Zone()
610         b = append(b, tz...)
611
612         return string(b)
613 }
614
615 // FmtTimeFull returns the full time representation of 't' for 'ru_BY'
616 func (ru *ru_BY) FmtTimeFull(t time.Time) string {
617
618         b := make([]byte, 0, 32)
619
620         b = strconv.AppendInt(b, int64(t.Hour()), 10)
621         b = append(b, ru.timeSeparator...)
622
623         if t.Minute() < 10 {
624                 b = append(b, '0')
625         }
626
627         b = strconv.AppendInt(b, int64(t.Minute()), 10)
628         b = append(b, ru.timeSeparator...)
629
630         if t.Second() < 10 {
631                 b = append(b, '0')
632         }
633
634         b = strconv.AppendInt(b, int64(t.Second()), 10)
635         b = append(b, []byte{0x20}...)
636
637         tz, _ := t.Zone()
638
639         if btz, ok := ru.timezones[tz]; ok {
640                 b = append(b, btz...)
641         } else {
642                 b = append(b, tz...)
643         }
644
645         return string(b)
646 }