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 monthsAbbreviated []string
29 daysAbbreviated []string
33 periodsAbbreviated []string
34 periodsNarrow []string
37 erasAbbreviated []string
40 timezones map[string]string
43 // New returns a new instance of translator for the 'es_VE' locale
44 func New() locales.Translator {
47 pluralsCardinal: []locales.PluralRule{2, 6},
48 pluralsOrdinal: []locales.PluralRule{6},
49 pluralsRange: []locales.PluralRule{6},
57 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", "Bs.", "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 monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "sept.", "oct.", "nov.", "dic."},
60 monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
61 monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "septiembre", "octubre", "noviembre", "diciembre"},
62 daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
63 daysNarrow: []string{"D", "L", "M", "X", "J", "V", "S"},
64 daysShort: []string{"Do", "Lu", "Ma", "Mi", "Ju", "Vi", "Sa"},
65 daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
66 periodsAbbreviated: []string{"a. m.", "p. m."},
67 periodsNarrow: []string{"a. m.", "p. m."},
68 periodsWide: []string{"a. m.", "p. m."},
69 erasAbbreviated: []string{"a. C.", "d. C."},
70 erasNarrow: []string{"", ""},
71 erasWide: []string{"antes de Cristo", "después de Cristo"},
72 timezones: map[string]string{"PST": "hora estándar del Pacífico", "ACWST": "hora estándar de Australia centroccidental", "HNNOMX": "hora estándar del noroeste de México", "HNOG": "hora estándar de Groenlandia occidental", "WAT": "hora estándar de África occidental", "HNCU": "hora estándar de Cuba", "HEPM": "hora de verano de San Pedro y Miquelón", "CDT": "hora de verano central", "AWST": "hora estándar de Australia occidental", "MESZ": "hora de verano de Europa central", "HEOG": "hora de verano de Groenlandia occidental", "ChST": "hora estándar de Chamorro", "CHAST": "hora estándar de Chatham", "HEEG": "hora de verano de Groenlandia oriental", "CAT": "hora de África central", "JST": "hora estándar de Japón", "AST": "hora estándar del Atlántico", "ARST": "hora de verano de Argentina", "AKST": "hora estándar de Alaska", "VET": "hora de Venezuela", "ADT": "hora de verano del Atlántico", "HNT": "hora estándar de Terranova", "COT": "hora estándar de Colombia", "HNPMX": "hora estándar del Pacífico de México", "HADT": "hora de verano de Hawái-Aleutiano", "OESZ": "hora de verano de Europa oriental", "LHST": "hora estándar de Lord Howe", "LHDT": "hora de verano de Lord Howe", "EAT": "hora de África oriental", "HNEG": "hora estándar de Groenlandia oriental", "CLT": "hora estándar de Chile", "WIB": "hora de Indonesia occidental", "CST": "hora estándar central", "MST": "Hora estándar de Macao", "ACWDT": "hora de verano de Australia centroccidental", "JDT": "hora de verano de Japón", "WITA": "hora de Indonesia central", "SGT": "hora de Singapur", "MDT": "Hora de verano de Macao", "MYT": "hora de Malasia", "UYT": "hora estándar de Uruguay", "AEDT": "hora de verano de Australia oriental", "WEZ": "hora estándar de Europa occidental", "HEPMX": "hora de verano del Pacífico de México", "TMT": "hora estándar de Turkmenistán", "SAST": "hora de Sudáfrica", "HAT": "hora de verano de Terranova", "HKST": "hora de verano de Hong Kong", "COST": "hora de verano de Colombia", "NZST": "hora estándar de Nueva Zelanda", "OEZ": "hora estándar de Europa oriental", "∅∅∅": "hora de verano de Perú", "PDT": "hora de verano del Pacífico", "SRT": "hora de Surinam", "TMST": "hora de verano de Turkmenistán", "IST": "hora estándar de la India", "WAST": "hora de verano de África occidental", "GYT": "hora de Guyana", "CHADT": "hora de verano de Chatham", "HNPM": "hora estándar de San Pedro y Miquelón", "BT": "hora de Bután", "UYST": "hora de verano de Uruguay", "NZDT": "hora de verano de Nueva Zelanda", "ART": "hora estándar de Argentina", "ECT": "hora de Ecuador", "GMT": "hora del meridiano de Greenwich", "WART": "hora estándar de Argentina occidental", "WARST": "hora de verano de Argentina occidental", "AEST": "hora estándar de Australia oriental", "EST": "hora estándar oriental", "HECU": "hora de verano de Cuba", "HAST": "hora estándar de Hawái-Aleutiano", "HENOMX": "hora de verano del noroeste de México", "ACDT": "hora de verano de Australia central", "AKDT": "hora de verano de Alaska", "ACST": "hora estándar de Australia central", "BOT": "hora de Bolivia", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "CLST": "hora de verano de Chile", "GFT": "hora de la Guayana Francesa", "EDT": "hora de verano oriental", "WESZ": "hora de verano de Europa occidental", "WIT": "hora de Indonesia oriental", "HKT": "hora estándar de Hong Kong"},
76 // Locale returns the current translators string locale
77 func (es *es_VE) Locale() string {
81 // PluralsCardinal returns the list of cardinal plural rules associated with 'es_VE'
82 func (es *es_VE) PluralsCardinal() []locales.PluralRule {
83 return es.pluralsCardinal
86 // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_VE'
87 func (es *es_VE) PluralsOrdinal() []locales.PluralRule {
88 return es.pluralsOrdinal
91 // PluralsRange returns the list of range plural rules associated with 'es_VE'
92 func (es *es_VE) PluralsRange() []locales.PluralRule {
93 return es.pluralsRange
96 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_VE'
97 func (es *es_VE) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
102 return locales.PluralRuleOne
105 return locales.PluralRuleOther
108 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_VE'
109 func (es *es_VE) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
110 return locales.PluralRuleOther
113 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_VE'
114 func (es *es_VE) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
115 return locales.PluralRuleOther
118 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
119 func (es *es_VE) MonthAbbreviated(month time.Month) string {
120 return es.monthsAbbreviated[month]
123 // MonthsAbbreviated returns the locales abbreviated months
124 func (es *es_VE) MonthsAbbreviated() []string {
125 return es.monthsAbbreviated[1:]
128 // MonthNarrow returns the locales narrow month given the 'month' provided
129 func (es *es_VE) MonthNarrow(month time.Month) string {
130 return es.monthsNarrow[month]
133 // MonthsNarrow returns the locales narrow months
134 func (es *es_VE) MonthsNarrow() []string {
135 return es.monthsNarrow[1:]
138 // MonthWide returns the locales wide month given the 'month' provided
139 func (es *es_VE) MonthWide(month time.Month) string {
140 return es.monthsWide[month]
143 // MonthsWide returns the locales wide months
144 func (es *es_VE) MonthsWide() []string {
145 return es.monthsWide[1:]
148 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
149 func (es *es_VE) WeekdayAbbreviated(weekday time.Weekday) string {
150 return es.daysAbbreviated[weekday]
153 // WeekdaysAbbreviated returns the locales abbreviated weekdays
154 func (es *es_VE) WeekdaysAbbreviated() []string {
155 return es.daysAbbreviated
158 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
159 func (es *es_VE) WeekdayNarrow(weekday time.Weekday) string {
160 return es.daysNarrow[weekday]
163 // WeekdaysNarrow returns the locales narrow weekdays
164 func (es *es_VE) WeekdaysNarrow() []string {
168 // WeekdayShort returns the locales short weekday given the 'weekday' provided
169 func (es *es_VE) WeekdayShort(weekday time.Weekday) string {
170 return es.daysShort[weekday]
173 // WeekdaysShort returns the locales short weekdays
174 func (es *es_VE) WeekdaysShort() []string {
178 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
179 func (es *es_VE) WeekdayWide(weekday time.Weekday) string {
180 return es.daysWide[weekday]
183 // WeekdaysWide returns the locales wide weekdays
184 func (es *es_VE) WeekdaysWide() []string {
188 // Decimal returns the decimal point of number
189 func (es *es_VE) Decimal() string {
193 // Group returns the group of number
194 func (es *es_VE) Group() string {
198 // Group returns the minus sign of number
199 func (es *es_VE) Minus() string {
203 // FmtNumber returns 'num' with digits/precision of 'v' for 'es_VE' and handles both Whole and Real numbers based on 'v'
204 func (es *es_VE) FmtNumber(num float64, v uint64) string {
206 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
207 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
210 b := make([]byte, 0, l)
212 for i := len(s) - 1; i >= 0; i-- {
215 b = append(b, es.decimal[0])
222 b = append(b, es.group[0])
233 b = append(b, es.minus[0])
237 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
238 b[i], b[j] = b[j], b[i]
244 // FmtPercent returns 'num' with digits/precision of 'v' for 'es_VE' and handles both Whole and Real numbers based on 'v'
245 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
246 func (es *es_VE) FmtPercent(num float64, v uint64) string {
247 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
249 b := make([]byte, 0, l)
251 for i := len(s) - 1; i >= 0; i-- {
254 b = append(b, es.decimal[0])
262 b = append(b, es.minus[0])
266 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
267 b[i], b[j] = b[j], b[i]
270 b = append(b, es.percentSuffix...)
272 b = append(b, es.percent...)
277 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_VE'
278 func (es *es_VE) 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) + 2 + 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])
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++ {
334 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_VE'
335 // in accounting notation.
336 func (es *es_VE) FmtAccounting(num float64, v uint64, currency currency.Type) string {
338 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
339 symbol := es.currencies[currency]
340 l := len(s) + len(symbol) + 2 + 1*len(s[:len(s)-int(v)-1])/3
343 b := make([]byte, 0, l)
345 for i := len(s) - 1; i >= 0; i-- {
348 b = append(b, es.decimal[0])
355 b = append(b, es.group[0])
367 for j := len(symbol) - 1; j >= 0; j-- {
368 b = append(b, symbol[j])
371 b = append(b, es.minus[0])
375 for j := len(symbol) - 1; j >= 0; j-- {
376 b = append(b, symbol[j])
382 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
383 b[i], b[j] = b[j], b[i]
389 b = append(b, es.decimal...)
392 for i := 0; i < 2-int(v); i++ {
400 // FmtDateShort returns the short date representation of 't' for 'es_VE'
401 func (es *es_VE) FmtDateShort(t time.Time) string {
403 b := make([]byte, 0, 32)
405 b = strconv.AppendInt(b, int64(t.Day()), 10)
406 b = append(b, []byte{0x2f}...)
407 b = strconv.AppendInt(b, int64(t.Month()), 10)
408 b = append(b, []byte{0x2f}...)
411 b = append(b, strconv.Itoa(t.Year())[2:]...)
413 b = append(b, strconv.Itoa(t.Year())[1:]...)
419 // FmtDateMedium returns the medium date representation of 't' for 'es_VE'
420 func (es *es_VE) FmtDateMedium(t time.Time) string {
422 b := make([]byte, 0, 32)
424 b = strconv.AppendInt(b, int64(t.Day()), 10)
425 b = append(b, []byte{0x20}...)
426 b = append(b, es.monthsAbbreviated[t.Month()]...)
427 b = append(b, []byte{0x20}...)
430 b = strconv.AppendInt(b, int64(t.Year()), 10)
432 b = strconv.AppendInt(b, int64(-t.Year()), 10)
438 // FmtDateLong returns the long date representation of 't' for 'es_VE'
439 func (es *es_VE) FmtDateLong(t time.Time) string {
441 b := make([]byte, 0, 32)
443 b = strconv.AppendInt(b, int64(t.Day()), 10)
444 b = append(b, []byte{0x20, 0x64, 0x65}...)
445 b = append(b, []byte{0x20}...)
446 b = append(b, es.monthsWide[t.Month()]...)
447 b = append(b, []byte{0x20, 0x64, 0x65}...)
448 b = append(b, []byte{0x20}...)
451 b = strconv.AppendInt(b, int64(t.Year()), 10)
453 b = strconv.AppendInt(b, int64(-t.Year()), 10)
459 // FmtDateFull returns the full date representation of 't' for 'es_VE'
460 func (es *es_VE) FmtDateFull(t time.Time) string {
462 b := make([]byte, 0, 32)
464 b = append(b, es.daysWide[t.Weekday()]...)
465 b = append(b, []byte{0x2c, 0x20}...)
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 // FmtTimeShort returns the short time representation of 't' for 'es_VE'
483 func (es *es_VE) FmtTimeShort(t time.Time) string {
485 b := make([]byte, 0, 32)
493 b = strconv.AppendInt(b, int64(h), 10)
494 b = append(b, es.timeSeparator...)
500 b = strconv.AppendInt(b, int64(t.Minute()), 10)
501 b = append(b, []byte{0x20}...)
504 b = append(b, es.periodsAbbreviated[0]...)
506 b = append(b, es.periodsAbbreviated[1]...)
512 // FmtTimeMedium returns the medium time representation of 't' for 'es_VE'
513 func (es *es_VE) FmtTimeMedium(t time.Time) string {
515 b := make([]byte, 0, 32)
523 b = strconv.AppendInt(b, int64(h), 10)
524 b = append(b, es.timeSeparator...)
530 b = strconv.AppendInt(b, int64(t.Minute()), 10)
531 b = append(b, es.timeSeparator...)
537 b = strconv.AppendInt(b, int64(t.Second()), 10)
538 b = append(b, []byte{0x20}...)
541 b = append(b, es.periodsAbbreviated[0]...)
543 b = append(b, es.periodsAbbreviated[1]...)
549 // FmtTimeLong returns the long time representation of 't' for 'es_VE'
550 func (es *es_VE) FmtTimeLong(t time.Time) string {
552 b := make([]byte, 0, 32)
560 b = strconv.AppendInt(b, int64(h), 10)
561 b = append(b, es.timeSeparator...)
567 b = strconv.AppendInt(b, int64(t.Minute()), 10)
568 b = append(b, es.timeSeparator...)
574 b = strconv.AppendInt(b, int64(t.Second()), 10)
575 b = append(b, []byte{0x20}...)
578 b = append(b, es.periodsAbbreviated[0]...)
580 b = append(b, es.periodsAbbreviated[1]...)
583 b = append(b, []byte{0x20}...)
591 // FmtTimeFull returns the full time representation of 't' for 'es_VE'
592 func (es *es_VE) FmtTimeFull(t time.Time) string {
594 b := make([]byte, 0, 32)
602 b = strconv.AppendInt(b, int64(h), 10)
603 b = append(b, es.timeSeparator...)
609 b = strconv.AppendInt(b, int64(t.Minute()), 10)
610 b = append(b, es.timeSeparator...)
616 b = strconv.AppendInt(b, int64(t.Second()), 10)
617 b = append(b, []byte{0x20}...)
620 b = append(b, es.periodsAbbreviated[0]...)
622 b = append(b, es.periodsAbbreviated[1]...)
625 b = append(b, []byte{0x20}...)
629 if btz, ok := es.timezones[tz]; ok {
630 b = append(b, btz...)