8 "github.com/go-playground/locales"
9 "github.com/go-playground/locales/currency"
14 pluralsCardinal []locales.PluralRule
15 pluralsOrdinal []locales.PluralRule
16 pluralsRange []locales.PluralRule
25 currencies []string // idx = enum of currency code
26 currencyPositiveSuffix string
27 currencyNegativeSuffix string
28 monthsAbbreviated []string
31 daysAbbreviated []string
35 periodsAbbreviated []string
36 periodsNarrow []string
39 erasAbbreviated []string
42 timezones map[string]string
45 // New returns a new instance of translator for the 'es_PA' locale
46 func New() locales.Translator {
49 pluralsCardinal: []locales.PluralRule{2, 6},
50 pluralsOrdinal: []locales.PluralRule{6},
51 pluralsRange: []locales.PluralRule{6},
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", "B/.", "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"},
61 currencyPositiveSuffix: " ",
62 currencyNegativeSuffix: " ",
63 monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."},
64 monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
65 monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"},
66 daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
67 daysNarrow: []string{"D", "L", "M", "X", "J", "V", "S"},
68 daysShort: []string{"DO", "LU", "MA", "MI", "JU", "VI", "SA"},
69 daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
70 periodsAbbreviated: []string{"a. m.", "p. m."},
71 periodsNarrow: []string{"a. m.", "p. m."},
72 periodsWide: []string{"a. m.", "p. m."},
73 erasAbbreviated: []string{"a. C.", "d. C."},
74 erasNarrow: []string{"", ""},
75 erasWide: []string{"antes de Cristo", "después de Cristo"},
76 timezones: map[string]string{"IST": "hora estándar de la India", "COT": "hora estándar de Colombia", "COST": "hora de verano de Colombia", "EST": "hora estándar oriental", "HNPM": "hora estándar de San Pedro y Miquelón", "CDT": "hora de verano central", "WART": "hora estándar de Argentina occidental", "∅∅∅": "hora de verano de las Azores", "WAT": "hora estándar de África occidental", "HNT": "hora estándar de Terranova", "ACDT": "hora de verano de Australia central", "WIT": "hora de Indonesia oriental", "HADT": "hora de verano de Hawái-Aleutiano", "AEDT": "hora de verano de Australia oriental", "EAT": "hora de África oriental", "WAST": "hora de verano de África occidental", "AKST": "hora estándar de Alaska", "MDT": "Hora de verano de Macao", "LHST": "hora estándar de Lord Howe", "CLST": "hora de verano de Chile", "MYT": "hora de Malasia", "TMST": "hora de verano de Turkmenistán", "WARST": "hora de verano de Argentina occidental", "HEPMX": "hora de verano del Pacífico de México", "SAST": "hora de Sudáfrica", "WESZ": "hora de verano de Europa occidental", "ChST": "hora estándar de Chamorro", "CHAST": "hora estándar de Chatham", "HNOG": "hora estándar de Groenlandia occidental", "MESZ": "hora de verano de Europa central", "VET": "hora de Venezuela", "AST": "hora estándar del Atlántico", "AEST": "hora estándar de Australia oriental", "PST": "hora estándar del Pacífico", "BOT": "hora de Bolivia", "MST": "Hora estándar de Macao", "ARST": "hora de verano de Argentina", "CLT": "hora estándar de Chile", "EDT": "hora de verano oriental", "GYT": "hora de Guyana", "SGT": "hora de Singapur", "ACWDT": "hora de verano de Australia centroccidental", "HKT": "hora estándar de Hong Kong", "WEZ": "hora estándar de Europa occidental", "AWDT": "hora de verano de Australia occidental", "TMT": "hora estándar de Turkmenistán", "OESZ": "hora de verano de Europa oriental", "HAT": "hora de verano de Terranova", "HKST": "hora de verano de Hong Kong", "ACST": "hora estándar de Australia central", "HNPMX": "hora estándar del Pacífico de México", "WIB": "hora de Indonesia occidental", "WITA": "hora de Indonesia central", "ADT": "hora de verano del Atlántico", "GMT": "hora del meridiano de Greenwich", "HECU": "hora de verano de Cuba", "CST": "hora estándar central", "ACWST": "hora estándar de Australia centroccidental", "JST": "hora estándar de Japón", "HAST": "hora estándar de Hawái-Aleutiano", "OEZ": "hora estándar de Europa oriental", "ART": "hora estándar de Argentina", "HEOG": "hora de verano de Groenlandia occidental", "GFT": "hora de la Guayana Francesa", "CHADT": "hora de verano de Chatham", "HNCU": "hora estándar de Cuba", "UYST": "hora de verano de Uruguay", "AKDT": "hora de verano de Alaska", "BT": "hora de Bután", "NZDT": "hora de verano de Nueva Zelanda", "LHDT": "hora de verano de Lord Howe", "HNEG": "hora estándar de Groenlandia oriental", "HEEG": "hora de verano de Groenlandia oriental", "CAT": "hora de África central", "PDT": "hora de verano del Pacífico", "HEPM": "hora de verano de San Pedro y Miquelón", "NZST": "hora estándar de Nueva Zelanda", "HENOMX": "hora de verano del noroeste de México", "JDT": "hora de verano de Japón", "ECT": "hora de Ecuador", "AWST": "hora estándar de Australia occidental", "SRT": "hora de Surinam", "UYT": "hora estándar de Uruguay", "MEZ": "hora estándar de Europa central", "HNNOMX": "hora estándar del noroeste de México"},
80 // Locale returns the current translators string locale
81 func (es *es_PA) Locale() string {
85 // PluralsCardinal returns the list of cardinal plural rules associated with 'es_PA'
86 func (es *es_PA) PluralsCardinal() []locales.PluralRule {
87 return es.pluralsCardinal
90 // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_PA'
91 func (es *es_PA) PluralsOrdinal() []locales.PluralRule {
92 return es.pluralsOrdinal
95 // PluralsRange returns the list of range plural rules associated with 'es_PA'
96 func (es *es_PA) PluralsRange() []locales.PluralRule {
97 return es.pluralsRange
100 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_PA'
101 func (es *es_PA) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
106 return locales.PluralRuleOne
109 return locales.PluralRuleOther
112 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_PA'
113 func (es *es_PA) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
114 return locales.PluralRuleOther
117 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_PA'
118 func (es *es_PA) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
119 return locales.PluralRuleOther
122 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
123 func (es *es_PA) MonthAbbreviated(month time.Month) string {
124 return es.monthsAbbreviated[month]
127 // MonthsAbbreviated returns the locales abbreviated months
128 func (es *es_PA) MonthsAbbreviated() []string {
129 return es.monthsAbbreviated[1:]
132 // MonthNarrow returns the locales narrow month given the 'month' provided
133 func (es *es_PA) MonthNarrow(month time.Month) string {
134 return es.monthsNarrow[month]
137 // MonthsNarrow returns the locales narrow months
138 func (es *es_PA) MonthsNarrow() []string {
139 return es.monthsNarrow[1:]
142 // MonthWide returns the locales wide month given the 'month' provided
143 func (es *es_PA) MonthWide(month time.Month) string {
144 return es.monthsWide[month]
147 // MonthsWide returns the locales wide months
148 func (es *es_PA) MonthsWide() []string {
149 return es.monthsWide[1:]
152 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
153 func (es *es_PA) WeekdayAbbreviated(weekday time.Weekday) string {
154 return es.daysAbbreviated[weekday]
157 // WeekdaysAbbreviated returns the locales abbreviated weekdays
158 func (es *es_PA) WeekdaysAbbreviated() []string {
159 return es.daysAbbreviated
162 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
163 func (es *es_PA) WeekdayNarrow(weekday time.Weekday) string {
164 return es.daysNarrow[weekday]
167 // WeekdaysNarrow returns the locales narrow weekdays
168 func (es *es_PA) WeekdaysNarrow() []string {
172 // WeekdayShort returns the locales short weekday given the 'weekday' provided
173 func (es *es_PA) WeekdayShort(weekday time.Weekday) string {
174 return es.daysShort[weekday]
177 // WeekdaysShort returns the locales short weekdays
178 func (es *es_PA) WeekdaysShort() []string {
182 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
183 func (es *es_PA) WeekdayWide(weekday time.Weekday) string {
184 return es.daysWide[weekday]
187 // WeekdaysWide returns the locales wide weekdays
188 func (es *es_PA) WeekdaysWide() []string {
192 // Decimal returns the decimal point of number
193 func (es *es_PA) Decimal() string {
197 // Group returns the group of number
198 func (es *es_PA) Group() string {
202 // Group returns the minus sign of number
203 func (es *es_PA) Minus() string {
207 // FmtNumber returns 'num' with digits/precision of 'v' for 'es_PA' and handles both Whole and Real numbers based on 'v'
208 func (es *es_PA) FmtNumber(num float64, v uint64) string {
210 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
211 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
214 b := make([]byte, 0, l)
216 for i := len(s) - 1; i >= 0; i-- {
219 b = append(b, es.decimal[0])
226 b = append(b, es.group[0])
237 b = append(b, es.minus[0])
241 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
242 b[i], b[j] = b[j], b[i]
248 // FmtPercent returns 'num' with digits/precision of 'v' for 'es_PA' and handles both Whole and Real numbers based on 'v'
249 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
250 func (es *es_PA) FmtPercent(num float64, v uint64) string {
251 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
253 b := make([]byte, 0, l)
255 for i := len(s) - 1; i >= 0; i-- {
258 b = append(b, es.decimal[0])
266 b = append(b, es.minus[0])
270 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
271 b[i], b[j] = b[j], b[i]
274 b = append(b, es.percentSuffix...)
276 b = append(b, es.percent...)
281 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_PA'
282 func (es *es_PA) FmtCurrency(num float64, v uint64, currency currency.Type) string {
284 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
285 symbol := es.currencies[currency]
286 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
289 b := make([]byte, 0, l)
291 for i := len(s) - 1; i >= 0; i-- {
294 b = append(b, es.decimal[0])
301 b = append(b, es.group[0])
312 b = append(b, es.minus[0])
316 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
317 b[i], b[j] = b[j], b[i]
323 b = append(b, es.decimal...)
326 for i := 0; i < 2-int(v); i++ {
331 b = append(b, es.currencyPositiveSuffix...)
333 b = append(b, symbol...)
338 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_PA'
339 // in accounting notation.
340 func (es *es_PA) FmtAccounting(num float64, v uint64, currency currency.Type) string {
342 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
343 symbol := es.currencies[currency]
344 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
347 b := make([]byte, 0, l)
349 for i := len(s) - 1; i >= 0; i-- {
352 b = append(b, es.decimal[0])
359 b = append(b, es.group[0])
371 b = append(b, es.minus[0])
376 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
377 b[i], b[j] = b[j], b[i]
383 b = append(b, es.decimal...)
386 for i := 0; i < 2-int(v); i++ {
392 b = append(b, es.currencyNegativeSuffix...)
393 b = append(b, symbol...)
396 b = append(b, es.currencyPositiveSuffix...)
397 b = append(b, symbol...)
403 // FmtDateShort returns the short date representation of 't' for 'es_PA'
404 func (es *es_PA) FmtDateShort(t time.Time) string {
406 b := make([]byte, 0, 32)
412 b = strconv.AppendInt(b, int64(t.Month()), 10)
414 b = append(b, []byte{0x2f}...)
420 b = strconv.AppendInt(b, int64(t.Day()), 10)
421 b = append(b, []byte{0x2f}...)
424 b = append(b, strconv.Itoa(t.Year())[2:]...)
426 b = append(b, strconv.Itoa(t.Year())[1:]...)
432 // FmtDateMedium returns the medium date representation of 't' for 'es_PA'
433 func (es *es_PA) FmtDateMedium(t time.Time) string {
435 b := make([]byte, 0, 32)
441 b = strconv.AppendInt(b, int64(t.Month()), 10)
443 b = append(b, []byte{0x2f}...)
449 b = strconv.AppendInt(b, int64(t.Day()), 10)
450 b = append(b, []byte{0x2f}...)
453 b = strconv.AppendInt(b, int64(t.Year()), 10)
455 b = strconv.AppendInt(b, int64(-t.Year()), 10)
461 // FmtDateLong returns the long date representation of 't' for 'es_PA'
462 func (es *es_PA) FmtDateLong(t time.Time) string {
464 b := make([]byte, 0, 32)
466 b = strconv.AppendInt(b, int64(t.Day()), 10)
467 b = append(b, []byte{0x20, 0x64, 0x65}...)
468 b = append(b, []byte{0x20}...)
469 b = append(b, es.monthsWide[t.Month()]...)
470 b = append(b, []byte{0x20, 0x64, 0x65}...)
471 b = append(b, []byte{0x20}...)
474 b = strconv.AppendInt(b, int64(t.Year()), 10)
476 b = strconv.AppendInt(b, int64(-t.Year()), 10)
482 // FmtDateFull returns the full date representation of 't' for 'es_PA'
483 func (es *es_PA) FmtDateFull(t time.Time) string {
485 b := make([]byte, 0, 32)
487 b = append(b, es.daysWide[t.Weekday()]...)
488 b = append(b, []byte{0x2c, 0x20}...)
489 b = strconv.AppendInt(b, int64(t.Day()), 10)
490 b = append(b, []byte{0x20, 0x64, 0x65}...)
491 b = append(b, []byte{0x20}...)
492 b = append(b, es.monthsWide[t.Month()]...)
493 b = append(b, []byte{0x20, 0x64, 0x65}...)
494 b = append(b, []byte{0x20}...)
497 b = strconv.AppendInt(b, int64(t.Year()), 10)
499 b = strconv.AppendInt(b, int64(-t.Year()), 10)
505 // FmtTimeShort returns the short time representation of 't' for 'es_PA'
506 func (es *es_PA) FmtTimeShort(t time.Time) string {
508 b := make([]byte, 0, 32)
516 b = strconv.AppendInt(b, int64(h), 10)
517 b = append(b, es.timeSeparator...)
523 b = strconv.AppendInt(b, int64(t.Minute()), 10)
524 b = append(b, []byte{0x20}...)
527 b = append(b, es.periodsAbbreviated[0]...)
529 b = append(b, es.periodsAbbreviated[1]...)
535 // FmtTimeMedium returns the medium time representation of 't' for 'es_PA'
536 func (es *es_PA) FmtTimeMedium(t time.Time) string {
538 b := make([]byte, 0, 32)
546 b = strconv.AppendInt(b, int64(h), 10)
547 b = append(b, es.timeSeparator...)
553 b = strconv.AppendInt(b, int64(t.Minute()), 10)
554 b = append(b, es.timeSeparator...)
560 b = strconv.AppendInt(b, int64(t.Second()), 10)
561 b = append(b, []byte{0x20}...)
564 b = append(b, es.periodsAbbreviated[0]...)
566 b = append(b, es.periodsAbbreviated[1]...)
572 // FmtTimeLong returns the long time representation of 't' for 'es_PA'
573 func (es *es_PA) FmtTimeLong(t time.Time) string {
575 b := make([]byte, 0, 32)
583 b = strconv.AppendInt(b, int64(h), 10)
584 b = append(b, es.timeSeparator...)
590 b = strconv.AppendInt(b, int64(t.Minute()), 10)
591 b = append(b, es.timeSeparator...)
597 b = strconv.AppendInt(b, int64(t.Second()), 10)
598 b = append(b, []byte{0x20}...)
601 b = append(b, es.periodsAbbreviated[0]...)
603 b = append(b, es.periodsAbbreviated[1]...)
606 b = append(b, []byte{0x20}...)
614 // FmtTimeFull returns the full time representation of 't' for 'es_PA'
615 func (es *es_PA) FmtTimeFull(t time.Time) string {
617 b := make([]byte, 0, 32)
625 b = strconv.AppendInt(b, int64(h), 10)
626 b = append(b, es.timeSeparator...)
632 b = strconv.AppendInt(b, int64(t.Minute()), 10)
633 b = append(b, es.timeSeparator...)
639 b = strconv.AppendInt(b, int64(t.Second()), 10)
640 b = append(b, []byte{0x20}...)
643 b = append(b, es.periodsAbbreviated[0]...)
645 b = append(b, es.periodsAbbreviated[1]...)
648 b = append(b, []byte{0x20}...)
652 if btz, ok := es.timezones[tz]; ok {
653 b = append(b, btz...)