OSDN Git Service

new repo
[bytom/vapor.git] / vendor / github.com / go-playground / locales / pt_BR / pt_BR.go
1 package pt_BR
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 pt_BR 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         currencyNegativePrefix 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 'pt_BR' locale
45 func New() locales.Translator {
46         return &pt_BR{
47                 locale:                 "pt_BR",
48                 pluralsCardinal:        []locales.PluralRule{2, 6},
49                 pluralsOrdinal:         []locales.PluralRule{6},
50                 pluralsRange:           []locales.PluralRule{2, 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", "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                 currencyNegativePrefix: "(",
60                 currencyNegativeSuffix: ")",
61                 monthsAbbreviated:      []string{"", "jan", "fev", "mar", "abr", "mai", "jun", "jul", "ago", "set", "out", "nov", "dez"},
62                 monthsNarrow:           []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
63                 monthsWide:             []string{"", "janeiro", "fevereiro", "março", "abril", "maio", "junho", "julho", "agosto", "setembro", "outubro", "novembro", "dezembro"},
64                 daysAbbreviated:        []string{"dom", "seg", "ter", "qua", "qui", "sex", "sáb"},
65                 daysNarrow:             []string{"D", "S", "T", "Q", "Q", "S", "S"},
66                 daysShort:              []string{"dom", "seg", "ter", "qua", "qui", "sex", "sáb"},
67                 daysWide:               []string{"domingo", "segunda-feira", "terça-feira", "quarta-feira", "quinta-feira", "sexta-feira", "sábado"},
68                 periodsAbbreviated:     []string{"AM", "PM"},
69                 periodsNarrow:          []string{"AM", "PM"},
70                 periodsWide:            []string{"AM", "PM"},
71                 erasAbbreviated:        []string{"a.C.", "d.C."},
72                 erasNarrow:             []string{"", ""},
73                 erasWide:               []string{"antes de Cristo", "depois de Cristo"},
74                 timezones:              map[string]string{"NZST": "Horário Padrão da Nova Zelândia", "TMT": "Horário Padrão do Turcomenistão", "LHST": "Horário Padrão de Lord Howe", "CLT": "Horário Padrão do Chile", "HKT": "Horário Padrão de Hong Kong", "WARST": "Horário de Verão da Argentina Ocidental", "ADT": "Horário de Verão do Atlântico", "BOT": "Horário da Bolívia", "HAST": "Horário Padrão do Havaí e Ilhas Aleutas", "AST": "Horário Padrão do Atlântico", "WEZ": "Horário Padrão da Europa Ocidental", "PDT": "Horário de Verão do Pacífico", "CHAST": "Horário Padrão de Chatham", "UYT": "Horário Padrão do Uruguai", "MST": "Horário Padrão da Montanha", "MDT": "Horário de Verão da Montanha", "EDT": "Horário de Verão Oriental", "AWST": "Horário Padrão da Austrália Ocidental", "ACWST": "Horário Padrão da Austrália Centro-Ocidental", "ACWDT": "Horário de Verão da Austrália Centro-Ocidental", "MYT": "Horário da Malásia", "HADT": "Horário de Verão do Havaí e Ilhas Aleutas", "AEST": "Horário Padrão da Austrália Oriental", "HEEG": "Horário de Verão da Groelândia Oriental", "WIB": "Horário da Indonésia Ocidental", "HNT": "Horário Padrão de Terra Nova", "BT": "Horário do Butão", "TMST": "Horário de Verão do Turcomenistão", "HNNOMX": "Horário Padrão do Noroeste do México", "ARST": "Horário de Verão da Argentina", "CLST": "Horário de Verão do Chile", "SRT": "Horário do Suriname", "CST": "Horário Padrão Central", "JDT": "Horário de Verão do Japão", "HKST": "Horário de Verão de Hong Kong", "HEPM": "Horário de Verão de Saint Pierre e Miquelon", "AKDT": "Horário de Verão do Alasca", "HNPMX": "Horário Padrão do Pacífico do México", "HNPM": "Horário Padrão de Saint Pierre e Miquelon", "HENOMX": "Horário de Verão do Noroeste do México", "ART": "Horário Padrão da Argentina", "HNOG": "Horário Padrão da Groenlândia Ocidental", "EAT": "Horário da África Oriental", "EST": "Horário Padrão Oriental", "CAT": "Horário da África Central", "HNCU": "Horário Padrão de Cuba", "HECU": "Horário de Verão de Cuba", "JST": "Horário Padrão do Japão", "OEZ": "Horário Padrão da Europa Oriental", "AEDT": "Horário de Verão da Austrália Oriental", "UYST": "Horário de Verão do Uruguai", "SGT": "Horário Padrão de Cingapura", "HNEG": "Horário Padrão da Groelândia Oriental", "COST": "Horário de Verão da Colômbia", "AKST": "Horário Padrão do Alasca", "HEPMX": "Horário de Verão do Pacífico do México", "CHADT": "Horário de Verão de Chatham", "MEZ": "Horário Padrão da Europa Central", "HEOG": "Horário de Verão da Groenlândia Ocidental", "GFT": "Horário da Guiana Francesa", "ACST": "Horário Padrão da Austrália Central", "ChST": "Horário de Chamorro", "AWDT": "Horário de Verão da Austrália Ocidental", "OESZ": "Horário de Verão da Europa Oriental", "HAT": "Horário de Verão de Terra Nova", "ACDT": "Horário de Verão da Austrália Central", "IST": "Horário Padrão da Índia", "COT": "Horário Padrão da Colômbia", "MESZ": "Horário de Verão da Europa Central", "WESZ": "Horário de Verão da Europa Ocidental", "PST": "Horário Padrão do Pacífico", "NZDT": "Horário de Verão da Nova Zelândia", "VET": "Horário da Venezuela", "WAST": "Horário de Verão da África Ocidental", "SAST": "Horário da África do Sul", "WIT": "Horário da Indonésia Oriental", "WART": "Horário Padrão da Argentina Ocidental", "WITA": "Horário da Indonésia Central", "ECT": "Horário do Equador", "GYT": "Horário da Guiana", "GMT": "Horário do Meridiano de Greenwich", "CDT": "Horário de Verão Central", "LHDT": "Horário de Verão de Lord Howe", "∅∅∅": "Horário de Verão dos Açores", "WAT": "Horário Padrão da África Ocidental"},
75         }
76 }
77
78 // Locale returns the current translators string locale
79 func (pt *pt_BR) Locale() string {
80         return pt.locale
81 }
82
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'pt_BR'
84 func (pt *pt_BR) PluralsCardinal() []locales.PluralRule {
85         return pt.pluralsCardinal
86 }
87
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'pt_BR'
89 func (pt *pt_BR) PluralsOrdinal() []locales.PluralRule {
90         return pt.pluralsOrdinal
91 }
92
93 // PluralsRange returns the list of range plural rules associated with 'pt_BR'
94 func (pt *pt_BR) PluralsRange() []locales.PluralRule {
95         return pt.pluralsRange
96 }
97
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'pt_BR'
99 func (pt *pt_BR) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
100
101         n := math.Abs(num)
102         i := int64(n)
103
104         if i >= 0 && i <= 1 {
105                 return locales.PluralRuleOne
106         }
107
108         return locales.PluralRuleOther
109 }
110
111 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'pt_BR'
112 func (pt *pt_BR) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
113         return locales.PluralRuleOther
114 }
115
116 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'pt_BR'
117 func (pt *pt_BR) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
118
119         start := pt.CardinalPluralRule(num1, v1)
120         end := pt.CardinalPluralRule(num2, v2)
121
122         if start == locales.PluralRuleOne && end == locales.PluralRuleOne {
123                 return locales.PluralRuleOne
124         } else if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
125                 return locales.PluralRuleOther
126         } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
127                 return locales.PluralRuleOne
128         }
129
130         return locales.PluralRuleOther
131
132 }
133
134 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
135 func (pt *pt_BR) MonthAbbreviated(month time.Month) string {
136         return pt.monthsAbbreviated[month]
137 }
138
139 // MonthsAbbreviated returns the locales abbreviated months
140 func (pt *pt_BR) MonthsAbbreviated() []string {
141         return pt.monthsAbbreviated[1:]
142 }
143
144 // MonthNarrow returns the locales narrow month given the 'month' provided
145 func (pt *pt_BR) MonthNarrow(month time.Month) string {
146         return pt.monthsNarrow[month]
147 }
148
149 // MonthsNarrow returns the locales narrow months
150 func (pt *pt_BR) MonthsNarrow() []string {
151         return pt.monthsNarrow[1:]
152 }
153
154 // MonthWide returns the locales wide month given the 'month' provided
155 func (pt *pt_BR) MonthWide(month time.Month) string {
156         return pt.monthsWide[month]
157 }
158
159 // MonthsWide returns the locales wide months
160 func (pt *pt_BR) MonthsWide() []string {
161         return pt.monthsWide[1:]
162 }
163
164 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
165 func (pt *pt_BR) WeekdayAbbreviated(weekday time.Weekday) string {
166         return pt.daysAbbreviated[weekday]
167 }
168
169 // WeekdaysAbbreviated returns the locales abbreviated weekdays
170 func (pt *pt_BR) WeekdaysAbbreviated() []string {
171         return pt.daysAbbreviated
172 }
173
174 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
175 func (pt *pt_BR) WeekdayNarrow(weekday time.Weekday) string {
176         return pt.daysNarrow[weekday]
177 }
178
179 // WeekdaysNarrow returns the locales narrow weekdays
180 func (pt *pt_BR) WeekdaysNarrow() []string {
181         return pt.daysNarrow
182 }
183
184 // WeekdayShort returns the locales short weekday given the 'weekday' provided
185 func (pt *pt_BR) WeekdayShort(weekday time.Weekday) string {
186         return pt.daysShort[weekday]
187 }
188
189 // WeekdaysShort returns the locales short weekdays
190 func (pt *pt_BR) WeekdaysShort() []string {
191         return pt.daysShort
192 }
193
194 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
195 func (pt *pt_BR) WeekdayWide(weekday time.Weekday) string {
196         return pt.daysWide[weekday]
197 }
198
199 // WeekdaysWide returns the locales wide weekdays
200 func (pt *pt_BR) WeekdaysWide() []string {
201         return pt.daysWide
202 }
203
204 // Decimal returns the decimal point of number
205 func (pt *pt_BR) Decimal() string {
206         return pt.decimal
207 }
208
209 // Group returns the group of number
210 func (pt *pt_BR) Group() string {
211         return pt.group
212 }
213
214 // Group returns the minus sign of number
215 func (pt *pt_BR) Minus() string {
216         return pt.minus
217 }
218
219 // FmtNumber returns 'num' with digits/precision of 'v' for 'pt_BR' and handles both Whole and Real numbers based on 'v'
220 func (pt *pt_BR) FmtNumber(num float64, v uint64) string {
221
222         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
223         l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
224         count := 0
225         inWhole := v == 0
226         b := make([]byte, 0, l)
227
228         for i := len(s) - 1; i >= 0; i-- {
229
230                 if s[i] == '.' {
231                         b = append(b, pt.decimal[0])
232                         inWhole = true
233                         continue
234                 }
235
236                 if inWhole {
237                         if count == 3 {
238                                 b = append(b, pt.group[0])
239                                 count = 1
240                         } else {
241                                 count++
242                         }
243                 }
244
245                 b = append(b, s[i])
246         }
247
248         if num < 0 {
249                 b = append(b, pt.minus[0])
250         }
251
252         // reverse
253         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
254                 b[i], b[j] = b[j], b[i]
255         }
256
257         return string(b)
258 }
259
260 // FmtPercent returns 'num' with digits/precision of 'v' for 'pt_BR' and handles both Whole and Real numbers based on 'v'
261 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
262 func (pt *pt_BR) FmtPercent(num float64, v uint64) string {
263         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
264         l := len(s) + 3
265         b := make([]byte, 0, l)
266
267         for i := len(s) - 1; i >= 0; i-- {
268
269                 if s[i] == '.' {
270                         b = append(b, pt.decimal[0])
271                         continue
272                 }
273
274                 b = append(b, s[i])
275         }
276
277         if num < 0 {
278                 b = append(b, pt.minus[0])
279         }
280
281         // reverse
282         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
283                 b[i], b[j] = b[j], b[i]
284         }
285
286         b = append(b, pt.percent...)
287
288         return string(b)
289 }
290
291 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'pt_BR'
292 func (pt *pt_BR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
293
294         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
295         symbol := pt.currencies[currency]
296         l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
297         count := 0
298         inWhole := v == 0
299         b := make([]byte, 0, l)
300
301         for i := len(s) - 1; i >= 0; i-- {
302
303                 if s[i] == '.' {
304                         b = append(b, pt.decimal[0])
305                         inWhole = true
306                         continue
307                 }
308
309                 if inWhole {
310                         if count == 3 {
311                                 b = append(b, pt.group[0])
312                                 count = 1
313                         } else {
314                                 count++
315                         }
316                 }
317
318                 b = append(b, s[i])
319         }
320
321         for j := len(symbol) - 1; j >= 0; j-- {
322                 b = append(b, symbol[j])
323         }
324
325         if num < 0 {
326                 b = append(b, pt.minus[0])
327         }
328
329         // reverse
330         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
331                 b[i], b[j] = b[j], b[i]
332         }
333
334         if int(v) < 2 {
335
336                 if v == 0 {
337                         b = append(b, pt.decimal...)
338                 }
339
340                 for i := 0; i < 2-int(v); i++ {
341                         b = append(b, '0')
342                 }
343         }
344
345         return string(b)
346 }
347
348 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'pt_BR'
349 // in accounting notation.
350 func (pt *pt_BR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
351
352         s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
353         symbol := pt.currencies[currency]
354         l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
355         count := 0
356         inWhole := v == 0
357         b := make([]byte, 0, l)
358
359         for i := len(s) - 1; i >= 0; i-- {
360
361                 if s[i] == '.' {
362                         b = append(b, pt.decimal[0])
363                         inWhole = true
364                         continue
365                 }
366
367                 if inWhole {
368                         if count == 3 {
369                                 b = append(b, pt.group[0])
370                                 count = 1
371                         } else {
372                                 count++
373                         }
374                 }
375
376                 b = append(b, s[i])
377         }
378
379         if num < 0 {
380
381                 for j := len(symbol) - 1; j >= 0; j-- {
382                         b = append(b, symbol[j])
383                 }
384
385                 b = append(b, pt.currencyNegativePrefix[0])
386
387         } else {
388
389                 for j := len(symbol) - 1; j >= 0; j-- {
390                         b = append(b, symbol[j])
391                 }
392
393         }
394
395         // reverse
396         for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
397                 b[i], b[j] = b[j], b[i]
398         }
399
400         if int(v) < 2 {
401
402                 if v == 0 {
403                         b = append(b, pt.decimal...)
404                 }
405
406                 for i := 0; i < 2-int(v); i++ {
407                         b = append(b, '0')
408                 }
409         }
410
411         if num < 0 {
412                 b = append(b, pt.currencyNegativeSuffix...)
413         }
414
415         return string(b)
416 }
417
418 // FmtDateShort returns the short date representation of 't' for 'pt_BR'
419 func (pt *pt_BR) FmtDateShort(t time.Time) string {
420
421         b := make([]byte, 0, 32)
422
423         if t.Day() < 10 {
424                 b = append(b, '0')
425         }
426
427         b = strconv.AppendInt(b, int64(t.Day()), 10)
428         b = append(b, []byte{0x2f}...)
429
430         if t.Month() < 10 {
431                 b = append(b, '0')
432         }
433
434         b = strconv.AppendInt(b, int64(t.Month()), 10)
435
436         b = append(b, []byte{0x2f}...)
437
438         if t.Year() > 0 {
439                 b = strconv.AppendInt(b, int64(t.Year()), 10)
440         } else {
441                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
442         }
443
444         return string(b)
445 }
446
447 // FmtDateMedium returns the medium date representation of 't' for 'pt_BR'
448 func (pt *pt_BR) FmtDateMedium(t time.Time) string {
449
450         b := make([]byte, 0, 32)
451
452         b = strconv.AppendInt(b, int64(t.Day()), 10)
453         b = append(b, []byte{0x20, 0x64, 0x65}...)
454         b = append(b, []byte{0x20}...)
455         b = append(b, pt.monthsAbbreviated[t.Month()]...)
456         b = append(b, []byte{0x20, 0x64, 0x65}...)
457         b = append(b, []byte{0x20}...)
458
459         if t.Year() > 0 {
460                 b = strconv.AppendInt(b, int64(t.Year()), 10)
461         } else {
462                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
463         }
464
465         return string(b)
466 }
467
468 // FmtDateLong returns the long date representation of 't' for 'pt_BR'
469 func (pt *pt_BR) FmtDateLong(t time.Time) string {
470
471         b := make([]byte, 0, 32)
472
473         b = strconv.AppendInt(b, int64(t.Day()), 10)
474         b = append(b, []byte{0x20, 0x64, 0x65}...)
475         b = append(b, []byte{0x20}...)
476         b = append(b, pt.monthsWide[t.Month()]...)
477         b = append(b, []byte{0x20, 0x64, 0x65}...)
478         b = append(b, []byte{0x20}...)
479
480         if t.Year() > 0 {
481                 b = strconv.AppendInt(b, int64(t.Year()), 10)
482         } else {
483                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
484         }
485
486         return string(b)
487 }
488
489 // FmtDateFull returns the full date representation of 't' for 'pt_BR'
490 func (pt *pt_BR) FmtDateFull(t time.Time) string {
491
492         b := make([]byte, 0, 32)
493
494         b = append(b, pt.daysWide[t.Weekday()]...)
495         b = append(b, []byte{0x2c, 0x20}...)
496         b = strconv.AppendInt(b, int64(t.Day()), 10)
497         b = append(b, []byte{0x20, 0x64, 0x65}...)
498         b = append(b, []byte{0x20}...)
499         b = append(b, pt.monthsWide[t.Month()]...)
500         b = append(b, []byte{0x20, 0x64, 0x65}...)
501         b = append(b, []byte{0x20}...)
502
503         if t.Year() > 0 {
504                 b = strconv.AppendInt(b, int64(t.Year()), 10)
505         } else {
506                 b = strconv.AppendInt(b, int64(-t.Year()), 10)
507         }
508
509         return string(b)
510 }
511
512 // FmtTimeShort returns the short time representation of 't' for 'pt_BR'
513 func (pt *pt_BR) FmtTimeShort(t time.Time) string {
514
515         b := make([]byte, 0, 32)
516
517         if t.Hour() < 10 {
518                 b = append(b, '0')
519         }
520
521         b = strconv.AppendInt(b, int64(t.Hour()), 10)
522         b = append(b, pt.timeSeparator...)
523
524         if t.Minute() < 10 {
525                 b = append(b, '0')
526         }
527
528         b = strconv.AppendInt(b, int64(t.Minute()), 10)
529
530         return string(b)
531 }
532
533 // FmtTimeMedium returns the medium time representation of 't' for 'pt_BR'
534 func (pt *pt_BR) FmtTimeMedium(t time.Time) string {
535
536         b := make([]byte, 0, 32)
537
538         if t.Hour() < 10 {
539                 b = append(b, '0')
540         }
541
542         b = strconv.AppendInt(b, int64(t.Hour()), 10)
543         b = append(b, pt.timeSeparator...)
544
545         if t.Minute() < 10 {
546                 b = append(b, '0')
547         }
548
549         b = strconv.AppendInt(b, int64(t.Minute()), 10)
550         b = append(b, pt.timeSeparator...)
551
552         if t.Second() < 10 {
553                 b = append(b, '0')
554         }
555
556         b = strconv.AppendInt(b, int64(t.Second()), 10)
557
558         return string(b)
559 }
560
561 // FmtTimeLong returns the long time representation of 't' for 'pt_BR'
562 func (pt *pt_BR) FmtTimeLong(t time.Time) string {
563
564         b := make([]byte, 0, 32)
565
566         if t.Hour() < 10 {
567                 b = append(b, '0')
568         }
569
570         b = strconv.AppendInt(b, int64(t.Hour()), 10)
571         b = append(b, pt.timeSeparator...)
572
573         if t.Minute() < 10 {
574                 b = append(b, '0')
575         }
576
577         b = strconv.AppendInt(b, int64(t.Minute()), 10)
578         b = append(b, pt.timeSeparator...)
579
580         if t.Second() < 10 {
581                 b = append(b, '0')
582         }
583
584         b = strconv.AppendInt(b, int64(t.Second()), 10)
585         b = append(b, []byte{0x20}...)
586
587         tz, _ := t.Zone()
588         b = append(b, tz...)
589
590         return string(b)
591 }
592
593 // FmtTimeFull returns the full time representation of 't' for 'pt_BR'
594 func (pt *pt_BR) FmtTimeFull(t time.Time) string {
595
596         b := make([]byte, 0, 32)
597
598         if t.Hour() < 10 {
599                 b = append(b, '0')
600         }
601
602         b = strconv.AppendInt(b, int64(t.Hour()), 10)
603         b = append(b, pt.timeSeparator...)
604
605         if t.Minute() < 10 {
606                 b = append(b, '0')
607         }
608
609         b = strconv.AppendInt(b, int64(t.Minute()), 10)
610         b = append(b, pt.timeSeparator...)
611
612         if t.Second() < 10 {
613                 b = append(b, '0')
614         }
615
616         b = strconv.AppendInt(b, int64(t.Second()), 10)
617         b = append(b, []byte{0x20}...)
618
619         tz, _ := t.Zone()
620
621         if btz, ok := pt.timezones[tz]; ok {
622                 b = append(b, btz...)
623         } else {
624                 b = append(b, tz...)
625         }
626
627         return string(b)
628 }