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
24 currencies []string // idx = enum of currency code
25 currencyPositivePrefix string
26 currencyNegativePrefix string
27 monthsAbbreviated []string
30 daysAbbreviated []string
34 periodsAbbreviated []string
35 periodsNarrow []string
38 erasAbbreviated []string
41 timezones map[string]string
44 // New returns a new instance of translator for the 'es_CO' locale
45 func New() locales.Translator {
48 pluralsCardinal: []locales.PluralRule{2, 6},
49 pluralsOrdinal: []locales.PluralRule{6},
50 pluralsRange: []locales.PluralRule{6},
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", "$", "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", "US$", "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 currencyPositivePrefix: " ",
60 currencyNegativePrefix: " ",
61 monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."},
62 monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
63 monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"},
64 daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
65 daysNarrow: []string{"D", "L", "M", "M", "J", "V", "S"},
66 daysShort: []string{"DO", "LU", "MA", "MI", "JU", "VI", "SA"},
67 daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
68 periodsAbbreviated: []string{"a. m.", "p. m."},
69 periodsNarrow: []string{"a. m.", "p. m."},
70 periodsWide: []string{"a. m.", "p. m."},
71 erasAbbreviated: []string{"a. C.", "d. C."},
72 erasNarrow: []string{"", ""},
73 erasWide: []string{"antes de Cristo", "después de Cristo"},
74 timezones: map[string]string{"SGT": "hora de Singapur", "PDT": "hora de verano del Pacífico", "NZDT": "hora de verano de Nueva Zelanda", "HEOG": "hora de verano de Groenlandia occidental", "ACST": "hora estándar de Australia central", "WART": "hora estándar de Argentina occidental", "HENOMX": "hora de verano del noroeste de México", "CHADT": "hora de verano de Chatham", "OESZ": "hora de verano de Europa oriental", "IST": "hora estándar de la India", "AEDT": "hora de verano de Australia oriental", "ARST": "hora de verano de Argentina", "HKT": "hora estándar de Hong Kong", "AKST": "hora estándar de Alaska", "HEPM": "hora de verano de San Pedro y Miquelón", "UYT": "hora estándar de Uruguay", "TMT": "hora estándar de Turkmenistán", "LHST": "hora estándar de Lord Howe", "WAST": "hora de verano de África occidental", "CLST": "hora de verano de Chile", "AKDT": "hora de verano de Alaska", "CAT": "hora de África central", "BT": "hora de Bután", "MST": "Hora estándar de Macao", "AWDT": "hora de verano de Australia occidental", "TMST": "hora de verano de Turkmenistán", "HNEG": "hora estándar de Groenlandia oriental", "COST": "hora de verano de Colombia", "EST": "hora estándar oriental", "BOT": "hora de Bolivia", "CHAST": "hora estándar de Chatham", "HNCU": "hora estándar de Cuba", "JST": "hora estándar de Japón", "EDT": "hora de verano oriental", "ACDT": "hora de verano de Australia central", "MYT": "hora de Malasia", "HAST": "hora estándar de Hawái-Aleutiano", "SRT": "hora de Surinam", "LHDT": "hora de verano de Lord Howe", "EAT": "hora de África oriental", "SAST": "hora de Sudáfrica", "HNT": "hora estándar de Terranova", "HNPMX": "hora estándar del Pacífico de México", "ChST": "hora estándar de Chamorro", "WIT": "hora de Indonesia oriental", "HADT": "hora de verano de Hawái-Aleutiano", "JDT": "hora de verano de Japón", "AST": "hora estándar del Atlántico", "ART": "hora estándar de Argentina", "GYT": "hora de Guyana", "GMT": "hora del meridiano de Greenwich", "OEZ": "hora estándar de Europa oriental", "AWST": "hora estándar de Australia occidental", "VET": "hora de Venezuela", "HAT": "hora de verano de Terranova", "HKST": "hora de verano de Hong Kong", "ECT": "hora de Ecuador", "WESZ": "hora de verano de Europa occidental", "HNPM": "hora estándar de San Pedro y Miquelón", "UYST": "hora de verano de Uruguay", "WARST": "hora de verano de Argentina occidental", "HNNOMX": "hora estándar del noroeste de México", "CLT": "hora estándar de Chile", "COT": "hora estándar de Colombia", "WEZ": "hora estándar de Europa occidental", "HECU": "hora de verano de Cuba", "ACWDT": "hora de verano de Australia centroccidental", "ADT": "hora de verano del Atlántico", "AEST": "hora estándar de Australia oriental", "WAT": "hora estándar de África occidental", "MDT": "Hora de verano de Macao", "WIB": "hora de Indonesia occidental", "PST": "hora estándar del Pacífico", "CDT": "hora de verano central", "HEPMX": "hora de verano del Pacífico de México", "CST": "hora estándar central", "MEZ": "hora estándar de Europa central", "NZST": "hora estándar de Nueva Zelanda", "ACWST": "hora estándar de Australia centroccidental", "MESZ": "hora de verano de Europa central", "WITA": "hora de Indonesia central", "HNOG": "hora estándar de Groenlandia occidental", "HEEG": "hora de verano de Groenlandia oriental", "GFT": "hora de la Guayana Francesa", "∅∅∅": "hora de verano del Amazonas"},
78 // Locale returns the current translators string locale
79 func (es *es_CO) Locale() string {
83 // PluralsCardinal returns the list of cardinal plural rules associated with 'es_CO'
84 func (es *es_CO) PluralsCardinal() []locales.PluralRule {
85 return es.pluralsCardinal
88 // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_CO'
89 func (es *es_CO) PluralsOrdinal() []locales.PluralRule {
90 return es.pluralsOrdinal
93 // PluralsRange returns the list of range plural rules associated with 'es_CO'
94 func (es *es_CO) PluralsRange() []locales.PluralRule {
95 return es.pluralsRange
98 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_CO'
99 func (es *es_CO) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
104 return locales.PluralRuleOne
107 return locales.PluralRuleOther
110 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_CO'
111 func (es *es_CO) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
112 return locales.PluralRuleOther
115 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_CO'
116 func (es *es_CO) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
117 return locales.PluralRuleOther
120 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
121 func (es *es_CO) MonthAbbreviated(month time.Month) string {
122 return es.monthsAbbreviated[month]
125 // MonthsAbbreviated returns the locales abbreviated months
126 func (es *es_CO) MonthsAbbreviated() []string {
127 return es.monthsAbbreviated[1:]
130 // MonthNarrow returns the locales narrow month given the 'month' provided
131 func (es *es_CO) MonthNarrow(month time.Month) string {
132 return es.monthsNarrow[month]
135 // MonthsNarrow returns the locales narrow months
136 func (es *es_CO) MonthsNarrow() []string {
137 return es.monthsNarrow[1:]
140 // MonthWide returns the locales wide month given the 'month' provided
141 func (es *es_CO) MonthWide(month time.Month) string {
142 return es.monthsWide[month]
145 // MonthsWide returns the locales wide months
146 func (es *es_CO) MonthsWide() []string {
147 return es.monthsWide[1:]
150 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
151 func (es *es_CO) WeekdayAbbreviated(weekday time.Weekday) string {
152 return es.daysAbbreviated[weekday]
155 // WeekdaysAbbreviated returns the locales abbreviated weekdays
156 func (es *es_CO) WeekdaysAbbreviated() []string {
157 return es.daysAbbreviated
160 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
161 func (es *es_CO) WeekdayNarrow(weekday time.Weekday) string {
162 return es.daysNarrow[weekday]
165 // WeekdaysNarrow returns the locales narrow weekdays
166 func (es *es_CO) WeekdaysNarrow() []string {
170 // WeekdayShort returns the locales short weekday given the 'weekday' provided
171 func (es *es_CO) WeekdayShort(weekday time.Weekday) string {
172 return es.daysShort[weekday]
175 // WeekdaysShort returns the locales short weekdays
176 func (es *es_CO) WeekdaysShort() []string {
180 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
181 func (es *es_CO) WeekdayWide(weekday time.Weekday) string {
182 return es.daysWide[weekday]
185 // WeekdaysWide returns the locales wide weekdays
186 func (es *es_CO) WeekdaysWide() []string {
190 // Decimal returns the decimal point of number
191 func (es *es_CO) Decimal() string {
195 // Group returns the group of number
196 func (es *es_CO) Group() string {
200 // Group returns the minus sign of number
201 func (es *es_CO) Minus() string {
205 // FmtNumber returns 'num' with digits/precision of 'v' for 'es_CO' and handles both Whole and Real numbers based on 'v'
206 func (es *es_CO) FmtNumber(num float64, v uint64) string {
208 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
209 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
212 b := make([]byte, 0, l)
214 for i := len(s) - 1; i >= 0; i-- {
217 b = append(b, es.decimal[0])
224 b = append(b, es.group[0])
235 b = append(b, es.minus[0])
239 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
240 b[i], b[j] = b[j], b[i]
246 // FmtPercent returns 'num' with digits/precision of 'v' for 'es_CO' and handles both Whole and Real numbers based on 'v'
247 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
248 func (es *es_CO) FmtPercent(num float64, v uint64) string {
249 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
251 b := make([]byte, 0, l)
253 for i := len(s) - 1; i >= 0; i-- {
256 b = append(b, es.decimal[0])
264 b = append(b, es.minus[0])
268 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
269 b[i], b[j] = b[j], b[i]
272 b = append(b, es.percent...)
277 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_CO'
278 func (es *es_CO) FmtCurrency(num float64, v uint64, currency currency.Type) string {
280 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
281 symbol := es.currencies[currency]
282 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
285 b := make([]byte, 0, l)
287 for i := len(s) - 1; i >= 0; i-- {
290 b = append(b, es.decimal[0])
297 b = append(b, es.group[0])
307 for j := len(symbol) - 1; j >= 0; j-- {
308 b = append(b, symbol[j])
311 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
312 b = append(b, es.currencyPositivePrefix[j])
316 b = append(b, es.minus[0])
320 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
321 b[i], b[j] = b[j], b[i]
327 b = append(b, es.decimal...)
330 for i := 0; i < 2-int(v); i++ {
338 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_CO'
339 // in accounting notation.
340 func (es *es_CO) 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 for j := len(symbol) - 1; j >= 0; j-- {
372 b = append(b, symbol[j])
375 for j := len(es.currencyNegativePrefix) - 1; j >= 0; j-- {
376 b = append(b, es.currencyNegativePrefix[j])
379 b = append(b, es.minus[0])
383 for j := len(symbol) - 1; j >= 0; j-- {
384 b = append(b, symbol[j])
387 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
388 b = append(b, es.currencyPositivePrefix[j])
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]
401 b = append(b, es.decimal...)
404 for i := 0; i < 2-int(v); i++ {
412 // FmtDateShort returns the short date representation of 't' for 'es_CO'
413 func (es *es_CO) FmtDateShort(t time.Time) string {
415 b := make([]byte, 0, 32)
417 b = strconv.AppendInt(b, int64(t.Day()), 10)
418 b = append(b, []byte{0x2f}...)
424 b = strconv.AppendInt(b, int64(t.Month()), 10)
426 b = append(b, []byte{0x2f}...)
429 b = append(b, strconv.Itoa(t.Year())[2:]...)
431 b = append(b, strconv.Itoa(t.Year())[1:]...)
437 // FmtDateMedium returns the medium date representation of 't' for 'es_CO'
438 func (es *es_CO) FmtDateMedium(t time.Time) string {
440 b := make([]byte, 0, 32)
442 b = strconv.AppendInt(b, int64(t.Day()), 10)
443 b = append(b, []byte{0x2f}...)
449 b = strconv.AppendInt(b, int64(t.Month()), 10)
451 b = append(b, []byte{0x2f}...)
454 b = strconv.AppendInt(b, int64(t.Year()), 10)
456 b = strconv.AppendInt(b, int64(-t.Year()), 10)
462 // FmtDateLong returns the long date representation of 't' for 'es_CO'
463 func (es *es_CO) FmtDateLong(t time.Time) string {
465 b := make([]byte, 0, 32)
467 b = strconv.AppendInt(b, int64(t.Day()), 10)
468 b = append(b, []byte{0x20, 0x64, 0x65}...)
469 b = append(b, []byte{0x20}...)
470 b = append(b, es.monthsWide[t.Month()]...)
471 b = append(b, []byte{0x20, 0x64, 0x65}...)
472 b = append(b, []byte{0x20}...)
475 b = strconv.AppendInt(b, int64(t.Year()), 10)
477 b = strconv.AppendInt(b, int64(-t.Year()), 10)
483 // FmtDateFull returns the full date representation of 't' for 'es_CO'
484 func (es *es_CO) FmtDateFull(t time.Time) string {
486 b := make([]byte, 0, 32)
488 b = append(b, es.daysWide[t.Weekday()]...)
489 b = append(b, []byte{0x2c, 0x20}...)
490 b = strconv.AppendInt(b, int64(t.Day()), 10)
491 b = append(b, []byte{0x20, 0x64, 0x65}...)
492 b = append(b, []byte{0x20}...)
493 b = append(b, es.monthsWide[t.Month()]...)
494 b = append(b, []byte{0x20, 0x64, 0x65}...)
495 b = append(b, []byte{0x20}...)
498 b = strconv.AppendInt(b, int64(t.Year()), 10)
500 b = strconv.AppendInt(b, int64(-t.Year()), 10)
506 // FmtTimeShort returns the short time representation of 't' for 'es_CO'
507 func (es *es_CO) FmtTimeShort(t time.Time) string {
509 b := make([]byte, 0, 32)
517 b = strconv.AppendInt(b, int64(h), 10)
518 b = append(b, es.timeSeparator...)
524 b = strconv.AppendInt(b, int64(t.Minute()), 10)
525 b = append(b, []byte{0x20}...)
528 b = append(b, es.periodsAbbreviated[0]...)
530 b = append(b, es.periodsAbbreviated[1]...)
536 // FmtTimeMedium returns the medium time representation of 't' for 'es_CO'
537 func (es *es_CO) FmtTimeMedium(t time.Time) string {
539 b := make([]byte, 0, 32)
547 b = strconv.AppendInt(b, int64(h), 10)
548 b = append(b, es.timeSeparator...)
554 b = strconv.AppendInt(b, int64(t.Minute()), 10)
555 b = append(b, es.timeSeparator...)
561 b = strconv.AppendInt(b, int64(t.Second()), 10)
562 b = append(b, []byte{0x20}...)
565 b = append(b, es.periodsAbbreviated[0]...)
567 b = append(b, es.periodsAbbreviated[1]...)
573 // FmtTimeLong returns the long time representation of 't' for 'es_CO'
574 func (es *es_CO) FmtTimeLong(t time.Time) string {
576 b := make([]byte, 0, 32)
584 b = strconv.AppendInt(b, int64(h), 10)
585 b = append(b, es.timeSeparator...)
591 b = strconv.AppendInt(b, int64(t.Minute()), 10)
592 b = append(b, es.timeSeparator...)
598 b = strconv.AppendInt(b, int64(t.Second()), 10)
599 b = append(b, []byte{0x20}...)
602 b = append(b, es.periodsAbbreviated[0]...)
604 b = append(b, es.periodsAbbreviated[1]...)
607 b = append(b, []byte{0x20}...)
615 // FmtTimeFull returns the full time representation of 't' for 'es_CO'
616 func (es *es_CO) FmtTimeFull(t time.Time) string {
618 b := make([]byte, 0, 32)
626 b = strconv.AppendInt(b, int64(h), 10)
627 b = append(b, es.timeSeparator...)
633 b = strconv.AppendInt(b, int64(t.Minute()), 10)
634 b = append(b, es.timeSeparator...)
640 b = strconv.AppendInt(b, int64(t.Second()), 10)
641 b = append(b, []byte{0x20}...)
644 b = append(b, es.periodsAbbreviated[0]...)
646 b = append(b, es.periodsAbbreviated[1]...)
649 b = append(b, []byte{0x20}...)
653 if btz, ok := es.timezones[tz]; ok {
654 b = append(b, btz...)