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 currencyPositivePrefix string
27 currencyNegativePrefix string
28 currencyNegativeSuffix string
29 monthsAbbreviated []string
32 daysAbbreviated []string
36 periodsAbbreviated []string
37 periodsNarrow []string
40 erasAbbreviated []string
43 timezones map[string]string
46 // New returns a new instance of translator for the 'es_UY' locale
47 func New() locales.Translator {
50 pluralsCardinal: []locales.PluralRule{2, 6},
51 pluralsOrdinal: []locales.PluralRule{6},
52 pluralsRange: []locales.PluralRule{6},
60 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", "US$", "USN", "USS", "UYI", "UYP", "$", "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"},
62 currencyPositivePrefix: " ",
63 currencyNegativePrefix: "( ",
64 currencyNegativeSuffix: ")",
65 monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "set.", "oct.", "nov.", "dic."},
66 monthsNarrow: []string{"", "E", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
67 monthsWide: []string{"", "enero", "febrero", "marzo", "abril", "mayo", "junio", "julio", "agosto", "setiembre", "octubre", "noviembre", "diciembre"},
68 daysAbbreviated: []string{"dom.", "lun.", "mar.", "mié.", "jue.", "vie.", "sáb."},
69 daysNarrow: []string{"D", "L", "M", "X", "J", "V", "S"},
70 daysShort: []string{"DO", "LU", "MA", "MI", "JU", "VI", "SA"},
71 daysWide: []string{"domingo", "lunes", "martes", "miércoles", "jueves", "viernes", "sábado"},
72 periodsAbbreviated: []string{"a. m.", "p. m."},
73 periodsNarrow: []string{"a. m.", "p. m."},
74 periodsWide: []string{"a. m.", "p. m."},
75 erasAbbreviated: []string{"a. C.", "d. C."},
76 erasNarrow: []string{"", ""},
77 erasWide: []string{"antes de Cristo", "después de Cristo"},
78 timezones: map[string]string{"GYT": "hora de Guyana", "ECT": "hora de Ecuador", "HNCU": "hora estándar de Cuba", "MST": "Hora estándar de Macao", "HAT": "hora de verano de Terranova", "EST": "hora estándar oriental", "MESZ": "hora de verano de Europa central", "HNNOMX": "hora estándar del noroeste de México", "HNOG": "hora estándar de Groenlandia occidental", "HEOG": "hora de verano de Groenlandia occidental", "HEEG": "hora de verano de Groenlandia oriental", "GMT": "hora del meridiano de Greenwich", "HNPM": "hora estándar de San Pedro y Miquelón", "ACWDT": "hora de verano de Australia centroccidental", "VET": "hora de Venezuela", "AEDT": "hora de verano de Australia oriental", "EAT": "hora de África oriental", "CHAST": "hora estándar de Chatham", "AWST": "hora estándar de Australia occidental", "WIT": "hora de Indonesia oriental", "LHDT": "hora de verano de Lord Howe", "IST": "hora estándar de la India", "ACWST": "hora estándar de Australia centroccidental", "LHST": "hora estándar de Lord Howe", "PDT": "hora de verano del Pacífico", "BT": "hora de Bután", "BOT": "hora de Bolivia", "MYT": "hora de Malasia", "NZST": "hora estándar de Nueva Zelanda", "HADT": "hora de verano de Hawái-Aleutiano", "SGT": "hora de Singapur", "CAT": "hora de África central", "HNEG": "hora estándar de Groenlandia oriental", "JDT": "hora de verano de Japón", "ADT": "hora de verano del Atlántico", "PST": "hora estándar del Pacífico", "UYT": "hora estándar de Uruguay", "UYST": "hora de verano de Uruguay", "OEZ": "hora estándar de Europa oriental", "ARST": "hora de verano de Argentina", "CLST": "hora de verano de Chile", "WESZ": "hora de verano de Europa occidental", "WIB": "hora de Indonesia occidental", "HEPM": "hora de verano de San Pedro y Miquelón", "AWDT": "hora de verano de Australia occidental", "WITA": "hora de Indonesia central", "ACST": "hora estándar de Australia central", "HNPMX": "hora estándar del Pacífico de México", "ART": "hora estándar de Argentina", "AKST": "hora estándar de Alaska", "JST": "hora estándar de Japón", "WART": "hora estándar de Argentina occidental", "HEPMX": "hora de verano del Pacífico de México", "CST": "hora estándar central", "CDT": "hora de verano central", "AEST": "hora estándar de Australia oriental", "HECU": "hora de verano de Cuba", "SRT": "hora de Surinam", "TMT": "hora estándar de Turkmenistán", "ACDT": "hora de verano de Australia central", "MDT": "Hora de verano de Macao", "GFT": "hora de la Guayana Francesa", "∅∅∅": "hora de verano del Amazonas", "WEZ": "hora estándar de Europa occidental", "ChST": "hora estándar de Chamorro", "CHADT": "hora de verano de Chatham", "NZDT": "hora de verano de Nueva Zelanda", "COT": "hora estándar de Colombia", "COST": "hora de verano de Colombia", "AST": "hora estándar del Atlántico", "WAT": "hora estándar de África occidental", "MEZ": "hora estándar de Europa central", "OESZ": "hora de verano de Europa oriental", "CLT": "hora estándar de Chile", "TMST": "hora de verano de Turkmenistán", "EDT": "hora de verano oriental", "AKDT": "hora de verano de Alaska", "WAST": "hora de verano de África occidental", "SAST": "hora de Sudáfrica", "HNT": "hora estándar de Terranova", "HKT": "hora estándar de Hong Kong", "WARST": "hora de verano de Argentina occidental", "HENOMX": "hora de verano del noroeste de México", "HKST": "hora de verano de Hong Kong", "HAST": "hora estándar de Hawái-Aleutiano"},
82 // Locale returns the current translators string locale
83 func (es *es_UY) Locale() string {
87 // PluralsCardinal returns the list of cardinal plural rules associated with 'es_UY'
88 func (es *es_UY) PluralsCardinal() []locales.PluralRule {
89 return es.pluralsCardinal
92 // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_UY'
93 func (es *es_UY) PluralsOrdinal() []locales.PluralRule {
94 return es.pluralsOrdinal
97 // PluralsRange returns the list of range plural rules associated with 'es_UY'
98 func (es *es_UY) PluralsRange() []locales.PluralRule {
99 return es.pluralsRange
102 // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_UY'
103 func (es *es_UY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
108 return locales.PluralRuleOne
111 return locales.PluralRuleOther
114 // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_UY'
115 func (es *es_UY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
116 return locales.PluralRuleOther
119 // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_UY'
120 func (es *es_UY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
121 return locales.PluralRuleOther
124 // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
125 func (es *es_UY) MonthAbbreviated(month time.Month) string {
126 return es.monthsAbbreviated[month]
129 // MonthsAbbreviated returns the locales abbreviated months
130 func (es *es_UY) MonthsAbbreviated() []string {
131 return es.monthsAbbreviated[1:]
134 // MonthNarrow returns the locales narrow month given the 'month' provided
135 func (es *es_UY) MonthNarrow(month time.Month) string {
136 return es.monthsNarrow[month]
139 // MonthsNarrow returns the locales narrow months
140 func (es *es_UY) MonthsNarrow() []string {
141 return es.monthsNarrow[1:]
144 // MonthWide returns the locales wide month given the 'month' provided
145 func (es *es_UY) MonthWide(month time.Month) string {
146 return es.monthsWide[month]
149 // MonthsWide returns the locales wide months
150 func (es *es_UY) MonthsWide() []string {
151 return es.monthsWide[1:]
154 // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
155 func (es *es_UY) WeekdayAbbreviated(weekday time.Weekday) string {
156 return es.daysAbbreviated[weekday]
159 // WeekdaysAbbreviated returns the locales abbreviated weekdays
160 func (es *es_UY) WeekdaysAbbreviated() []string {
161 return es.daysAbbreviated
164 // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
165 func (es *es_UY) WeekdayNarrow(weekday time.Weekday) string {
166 return es.daysNarrow[weekday]
169 // WeekdaysNarrow returns the locales narrow weekdays
170 func (es *es_UY) WeekdaysNarrow() []string {
174 // WeekdayShort returns the locales short weekday given the 'weekday' provided
175 func (es *es_UY) WeekdayShort(weekday time.Weekday) string {
176 return es.daysShort[weekday]
179 // WeekdaysShort returns the locales short weekdays
180 func (es *es_UY) WeekdaysShort() []string {
184 // WeekdayWide returns the locales wide weekday given the 'weekday' provided
185 func (es *es_UY) WeekdayWide(weekday time.Weekday) string {
186 return es.daysWide[weekday]
189 // WeekdaysWide returns the locales wide weekdays
190 func (es *es_UY) WeekdaysWide() []string {
194 // Decimal returns the decimal point of number
195 func (es *es_UY) Decimal() string {
199 // Group returns the group of number
200 func (es *es_UY) Group() string {
204 // Group returns the minus sign of number
205 func (es *es_UY) Minus() string {
209 // FmtNumber returns 'num' with digits/precision of 'v' for 'es_UY' and handles both Whole and Real numbers based on 'v'
210 func (es *es_UY) FmtNumber(num float64, v uint64) string {
212 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
213 l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
216 b := make([]byte, 0, l)
218 for i := len(s) - 1; i >= 0; i-- {
221 b = append(b, es.decimal[0])
228 b = append(b, es.group[0])
239 b = append(b, es.minus[0])
243 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
244 b[i], b[j] = b[j], b[i]
250 // FmtPercent returns 'num' with digits/precision of 'v' for 'es_UY' and handles both Whole and Real numbers based on 'v'
251 // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
252 func (es *es_UY) FmtPercent(num float64, v uint64) string {
253 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
255 b := make([]byte, 0, l)
257 for i := len(s) - 1; i >= 0; i-- {
260 b = append(b, es.decimal[0])
268 b = append(b, es.minus[0])
272 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
273 b[i], b[j] = b[j], b[i]
276 b = append(b, es.percentSuffix...)
278 b = append(b, es.percent...)
283 // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_UY'
284 func (es *es_UY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
286 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
287 symbol := es.currencies[currency]
288 l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
291 b := make([]byte, 0, l)
293 for i := len(s) - 1; i >= 0; i-- {
296 b = append(b, es.decimal[0])
303 b = append(b, es.group[0])
313 for j := len(symbol) - 1; j >= 0; j-- {
314 b = append(b, symbol[j])
317 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
318 b = append(b, es.currencyPositivePrefix[j])
322 b = append(b, es.minus[0])
326 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
327 b[i], b[j] = b[j], b[i]
333 b = append(b, es.decimal...)
336 for i := 0; i < 2-int(v); i++ {
344 // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_UY'
345 // in accounting notation.
346 func (es *es_UY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
348 s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
349 symbol := es.currencies[currency]
350 l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
353 b := make([]byte, 0, l)
355 for i := len(s) - 1; i >= 0; i-- {
358 b = append(b, es.decimal[0])
365 b = append(b, es.group[0])
377 for j := len(symbol) - 1; j >= 0; j-- {
378 b = append(b, symbol[j])
381 for j := len(es.currencyNegativePrefix) - 1; j >= 0; j-- {
382 b = append(b, es.currencyNegativePrefix[j])
387 for j := len(symbol) - 1; j >= 0; j-- {
388 b = append(b, symbol[j])
391 for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
392 b = append(b, es.currencyPositivePrefix[j])
398 for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
399 b[i], b[j] = b[j], b[i]
405 b = append(b, es.decimal...)
408 for i := 0; i < 2-int(v); i++ {
414 b = append(b, es.currencyNegativeSuffix...)
420 // FmtDateShort returns the short date representation of 't' for 'es_UY'
421 func (es *es_UY) FmtDateShort(t time.Time) string {
423 b := make([]byte, 0, 32)
425 b = strconv.AppendInt(b, int64(t.Day()), 10)
426 b = append(b, []byte{0x2f}...)
427 b = strconv.AppendInt(b, int64(t.Month()), 10)
428 b = append(b, []byte{0x2f}...)
431 b = append(b, strconv.Itoa(t.Year())[2:]...)
433 b = append(b, strconv.Itoa(t.Year())[1:]...)
439 // FmtDateMedium returns the medium date representation of 't' for 'es_UY'
440 func (es *es_UY) FmtDateMedium(t time.Time) string {
442 b := make([]byte, 0, 32)
444 b = strconv.AppendInt(b, int64(t.Day()), 10)
445 b = append(b, []byte{0x20}...)
446 b = append(b, es.monthsAbbreviated[t.Month()]...)
447 b = append(b, []byte{0x20}...)
450 b = strconv.AppendInt(b, int64(t.Year()), 10)
452 b = strconv.AppendInt(b, int64(-t.Year()), 10)
458 // FmtDateLong returns the long date representation of 't' for 'es_UY'
459 func (es *es_UY) FmtDateLong(t time.Time) string {
461 b := make([]byte, 0, 32)
463 b = strconv.AppendInt(b, int64(t.Day()), 10)
464 b = append(b, []byte{0x20, 0x64, 0x65}...)
465 b = append(b, []byte{0x20}...)
466 b = append(b, es.monthsWide[t.Month()]...)
467 b = append(b, []byte{0x20, 0x64, 0x65}...)
468 b = append(b, []byte{0x20}...)
471 b = strconv.AppendInt(b, int64(t.Year()), 10)
473 b = strconv.AppendInt(b, int64(-t.Year()), 10)
479 // FmtDateFull returns the full date representation of 't' for 'es_UY'
480 func (es *es_UY) FmtDateFull(t time.Time) string {
482 b := make([]byte, 0, 32)
484 b = append(b, es.daysWide[t.Weekday()]...)
485 b = append(b, []byte{0x2c, 0x20}...)
486 b = strconv.AppendInt(b, int64(t.Day()), 10)
487 b = append(b, []byte{0x20, 0x64, 0x65}...)
488 b = append(b, []byte{0x20}...)
489 b = append(b, es.monthsWide[t.Month()]...)
490 b = append(b, []byte{0x20, 0x64, 0x65}...)
491 b = append(b, []byte{0x20}...)
494 b = strconv.AppendInt(b, int64(t.Year()), 10)
496 b = strconv.AppendInt(b, int64(-t.Year()), 10)
502 // FmtTimeShort returns the short time representation of 't' for 'es_UY'
503 func (es *es_UY) FmtTimeShort(t time.Time) string {
505 b := make([]byte, 0, 32)
507 b = strconv.AppendInt(b, int64(t.Hour()), 10)
508 b = append(b, es.timeSeparator...)
514 b = strconv.AppendInt(b, int64(t.Minute()), 10)
519 // FmtTimeMedium returns the medium time representation of 't' for 'es_UY'
520 func (es *es_UY) FmtTimeMedium(t time.Time) string {
522 b := make([]byte, 0, 32)
524 b = strconv.AppendInt(b, int64(t.Hour()), 10)
525 b = append(b, es.timeSeparator...)
531 b = strconv.AppendInt(b, int64(t.Minute()), 10)
532 b = append(b, es.timeSeparator...)
538 b = strconv.AppendInt(b, int64(t.Second()), 10)
543 // FmtTimeLong returns the long time representation of 't' for 'es_UY'
544 func (es *es_UY) FmtTimeLong(t time.Time) string {
546 b := make([]byte, 0, 32)
548 b = strconv.AppendInt(b, int64(t.Hour()), 10)
549 b = append(b, es.timeSeparator...)
555 b = strconv.AppendInt(b, int64(t.Minute()), 10)
556 b = append(b, es.timeSeparator...)
562 b = strconv.AppendInt(b, int64(t.Second()), 10)
563 b = append(b, []byte{0x20}...)
571 // FmtTimeFull returns the full time representation of 't' for 'es_UY'
572 func (es *es_UY) FmtTimeFull(t time.Time) string {
574 b := make([]byte, 0, 32)
576 b = strconv.AppendInt(b, int64(t.Hour()), 10)
577 b = append(b, es.timeSeparator...)
583 b = strconv.AppendInt(b, int64(t.Minute()), 10)
584 b = append(b, es.timeSeparator...)
590 b = strconv.AppendInt(b, int64(t.Second()), 10)
591 b = append(b, []byte{0x20, 0x28}...)
595 if btz, ok := es.timezones[tz]; ok {
596 b = append(b, btz...)
601 b = append(b, []byte{0x29}...)