OSDN Git Service

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