es_UY.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618
  1. package es_UY
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type es_UY struct {
  10. locale string
  11. pluralsCardinal []locales.PluralRule
  12. pluralsOrdinal []locales.PluralRule
  13. pluralsRange []locales.PluralRule
  14. decimal string
  15. group string
  16. minus string
  17. percent string
  18. percentSuffix string
  19. perMille string
  20. timeSeparator string
  21. inifinity string
  22. currencies []string // idx = enum of currency code
  23. currencyPositivePrefix string
  24. currencyNegativePrefix string
  25. currencyNegativeSuffix string
  26. monthsAbbreviated []string
  27. monthsNarrow []string
  28. monthsWide []string
  29. daysAbbreviated []string
  30. daysNarrow []string
  31. daysShort []string
  32. daysWide []string
  33. periodsAbbreviated []string
  34. periodsNarrow []string
  35. periodsShort []string
  36. periodsWide []string
  37. erasAbbreviated []string
  38. erasNarrow []string
  39. erasWide []string
  40. timezones map[string]string
  41. }
  42. // New returns a new instance of translator for the 'es_UY' locale
  43. func New() locales.Translator {
  44. return &es_UY{
  45. locale: "es_UY",
  46. pluralsCardinal: []locales.PluralRule{2, 6},
  47. pluralsOrdinal: []locales.PluralRule{6},
  48. pluralsRange: []locales.PluralRule{6},
  49. decimal: ",",
  50. group: ".",
  51. minus: "-",
  52. percent: "%",
  53. perMille: "‰",
  54. timeSeparator: ":",
  55. inifinity: "∞",
  56. 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", "CNH", "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", "STN", "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"},
  57. percentSuffix: " ",
  58. currencyPositivePrefix: " ",
  59. currencyNegativePrefix: "( ",
  60. currencyNegativeSuffix: ")",
  61. monthsAbbreviated: []string{"", "ene.", "feb.", "mar.", "abr.", "may.", "jun.", "jul.", "ago.", "set.", "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", "setiembre", "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{"GFT": "hora de la Guayana Francesa", "EDT": "hora de verano oriental", "HNOG": "hora estándar de Groenlandia occidental", "LHST": "hora estándar de Lord Howe", "NZST": "hora estándar de Nueva Zelanda", "BT": "hora de Bután", "MDT": "Hora de verano de Macao", "OESZ": "hora de verano de Europa del Este", "ART": "hora estándar de Argentina", "AEDT": "hora de verano de Australia oriental", "JDT": "hora de verano de Japón", "OEZ": "hora estándar de Europa del Este", "COST": "hora de verano de Colombia", "GMT": "hora del meridiano de Greenwich", "NZDT": "hora de verano de Nueva Zelanda", "HNEG": "hora estándar de Groenlandia oriental", "HEPM": "hora de verano de San Pedro y Miquelón", "HEPMX": "hora de verano del Pacífico de México", "AEST": "hora estándar de Australia oriental", "SRT": "hora de Surinam", "CAT": "hora de África central", "UYT": "hora estándar de Uruguay", "HNCU": "hora estándar de Cuba", "HEEG": "hora de verano de Groenlandia oriental", "MESZ": "hora de verano de Europa central", "HKT": "hora estándar de Hong Kong", "HENOMX": "hora de verano del noroeste de México", "AWST": "hora estándar de Australia occidental", "ADT": "hora de verano del Atlántico", "WEZ": "hora estándar de Europa del Oeste", "HECU": "hora de verano de Cuba", "HEOG": "hora de verano de Groenlandia occidental", "HKST": "hora de verano de Hong Kong", "EAT": "hora de África oriental", "CLT": "hora estándar de Chile", "EST": "hora estándar oriental", "WARST": "hora de verano de Argentina occidental", "COT": "hora estándar de Colombia", "JST": "hora estándar de Japón", "WIB": "hora de Indonesia occidental", "ACDT": "hora de verano de Australia central", "HNT": "hora estándar de Terranova", "UYST": "hora de verano de Uruguay", "ChST": "hora estándar de Chamorro", "PDT": "hora de verano del Pacífico", "BOT": "hora de Bolivia", "∅∅∅": "hora de verano de las Azores", "LHDT": "hora de verano de Lord Howe", "HAT": "hora de verano de Terranova", "CHAST": "hora estándar de Chatham", "GYT": "hora de Guyana", "WAST": "hora de verano de África occidental", "AKST": "hora estándar de Alaska", "ECT": "hora de Ecuador", "ACST": "hora estándar de Australia central", "MEZ": "hora estándar de Europa central", "IST": "hora de India", "VET": "hora de Venezuela", "ACWDT": "hora de verano de Australia centroccidental", "WITA": "hora de Indonesia central", "AKDT": "hora de verano de Alaska", "SGT": "hora de Singapur", "MYT": "hora de Malasia", "WIT": "hora de Indonesia oriental", "HAST": "hora estándar de Hawái-Aleutianas", "HNPMX": "hora estándar del Pacífico de México", "WAT": "hora estándar de África occidental", "ARST": "hora de verano de Argentina", "CST": "hora estándar central", "AST": "hora estándar del Atlántico", "ACWST": "hora estándar de Australia centroccidental", "HNPM": "hora estándar de San Pedro y Miquelón", "HNNOMX": "hora estándar del noroeste de México", "TMST": "hora de verano de Turkmenistán", "WART": "hora estándar de Argentina occidental", "CHADT": "hora de verano de Chatham", "PST": "hora estándar del Pacífico", "AWDT": "hora de verano de Australia occidental", "CLST": "hora de verano de Chile", "TMT": "hora estándar de Turkmenistán", "HADT": "hora de verano de Hawái-Aleutianas", "CDT": "hora de verano central", "MST": "Hora estándar de Macao", "SAST": "hora de Sudáfrica", "WESZ": "hora de verano de Europa del Oeste"},
  75. }
  76. }
  77. // Locale returns the current translators string locale
  78. func (es *es_UY) Locale() string {
  79. return es.locale
  80. }
  81. // PluralsCardinal returns the list of cardinal plural rules associated with 'es_UY'
  82. func (es *es_UY) PluralsCardinal() []locales.PluralRule {
  83. return es.pluralsCardinal
  84. }
  85. // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_UY'
  86. func (es *es_UY) PluralsOrdinal() []locales.PluralRule {
  87. return es.pluralsOrdinal
  88. }
  89. // PluralsRange returns the list of range plural rules associated with 'es_UY'
  90. func (es *es_UY) PluralsRange() []locales.PluralRule {
  91. return es.pluralsRange
  92. }
  93. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_UY'
  94. func (es *es_UY) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  95. n := math.Abs(num)
  96. if n == 1 {
  97. return locales.PluralRuleOne
  98. }
  99. return locales.PluralRuleOther
  100. }
  101. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'es_UY'
  102. func (es *es_UY) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  103. return locales.PluralRuleOther
  104. }
  105. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'es_UY'
  106. func (es *es_UY) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  107. return locales.PluralRuleOther
  108. }
  109. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  110. func (es *es_UY) MonthAbbreviated(month time.Month) string {
  111. return es.monthsAbbreviated[month]
  112. }
  113. // MonthsAbbreviated returns the locales abbreviated months
  114. func (es *es_UY) MonthsAbbreviated() []string {
  115. return es.monthsAbbreviated[1:]
  116. }
  117. // MonthNarrow returns the locales narrow month given the 'month' provided
  118. func (es *es_UY) MonthNarrow(month time.Month) string {
  119. return es.monthsNarrow[month]
  120. }
  121. // MonthsNarrow returns the locales narrow months
  122. func (es *es_UY) MonthsNarrow() []string {
  123. return es.monthsNarrow[1:]
  124. }
  125. // MonthWide returns the locales wide month given the 'month' provided
  126. func (es *es_UY) MonthWide(month time.Month) string {
  127. return es.monthsWide[month]
  128. }
  129. // MonthsWide returns the locales wide months
  130. func (es *es_UY) MonthsWide() []string {
  131. return es.monthsWide[1:]
  132. }
  133. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  134. func (es *es_UY) WeekdayAbbreviated(weekday time.Weekday) string {
  135. return es.daysAbbreviated[weekday]
  136. }
  137. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  138. func (es *es_UY) WeekdaysAbbreviated() []string {
  139. return es.daysAbbreviated
  140. }
  141. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  142. func (es *es_UY) WeekdayNarrow(weekday time.Weekday) string {
  143. return es.daysNarrow[weekday]
  144. }
  145. // WeekdaysNarrow returns the locales narrow weekdays
  146. func (es *es_UY) WeekdaysNarrow() []string {
  147. return es.daysNarrow
  148. }
  149. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  150. func (es *es_UY) WeekdayShort(weekday time.Weekday) string {
  151. return es.daysShort[weekday]
  152. }
  153. // WeekdaysShort returns the locales short weekdays
  154. func (es *es_UY) WeekdaysShort() []string {
  155. return es.daysShort
  156. }
  157. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  158. func (es *es_UY) WeekdayWide(weekday time.Weekday) string {
  159. return es.daysWide[weekday]
  160. }
  161. // WeekdaysWide returns the locales wide weekdays
  162. func (es *es_UY) WeekdaysWide() []string {
  163. return es.daysWide
  164. }
  165. // Decimal returns the decimal point of number
  166. func (es *es_UY) Decimal() string {
  167. return es.decimal
  168. }
  169. // Group returns the group of number
  170. func (es *es_UY) Group() string {
  171. return es.group
  172. }
  173. // Group returns the minus sign of number
  174. func (es *es_UY) Minus() string {
  175. return es.minus
  176. }
  177. // FmtNumber returns 'num' with digits/precision of 'v' for 'es_UY' and handles both Whole and Real numbers based on 'v'
  178. func (es *es_UY) FmtNumber(num float64, v uint64) string {
  179. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  180. l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
  181. count := 0
  182. inWhole := v == 0
  183. b := make([]byte, 0, l)
  184. for i := len(s) - 1; i >= 0; i-- {
  185. if s[i] == '.' {
  186. b = append(b, es.decimal[0])
  187. inWhole = true
  188. continue
  189. }
  190. if inWhole {
  191. if count == 3 {
  192. b = append(b, es.group[0])
  193. count = 1
  194. } else {
  195. count++
  196. }
  197. }
  198. b = append(b, s[i])
  199. }
  200. if num < 0 {
  201. b = append(b, es.minus[0])
  202. }
  203. // reverse
  204. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  205. b[i], b[j] = b[j], b[i]
  206. }
  207. return string(b)
  208. }
  209. // FmtPercent returns 'num' with digits/precision of 'v' for 'es_UY' and handles both Whole and Real numbers based on 'v'
  210. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  211. func (es *es_UY) FmtPercent(num float64, v uint64) string {
  212. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  213. l := len(s) + 5
  214. b := make([]byte, 0, l)
  215. for i := len(s) - 1; i >= 0; i-- {
  216. if s[i] == '.' {
  217. b = append(b, es.decimal[0])
  218. continue
  219. }
  220. b = append(b, s[i])
  221. }
  222. if num < 0 {
  223. b = append(b, es.minus[0])
  224. }
  225. // reverse
  226. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  227. b[i], b[j] = b[j], b[i]
  228. }
  229. b = append(b, es.percentSuffix...)
  230. b = append(b, es.percent...)
  231. return string(b)
  232. }
  233. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_UY'
  234. func (es *es_UY) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  235. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  236. symbol := es.currencies[currency]
  237. l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
  238. count := 0
  239. inWhole := v == 0
  240. b := make([]byte, 0, l)
  241. for i := len(s) - 1; i >= 0; i-- {
  242. if s[i] == '.' {
  243. b = append(b, es.decimal[0])
  244. inWhole = true
  245. continue
  246. }
  247. if inWhole {
  248. if count == 3 {
  249. b = append(b, es.group[0])
  250. count = 1
  251. } else {
  252. count++
  253. }
  254. }
  255. b = append(b, s[i])
  256. }
  257. for j := len(symbol) - 1; j >= 0; j-- {
  258. b = append(b, symbol[j])
  259. }
  260. for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
  261. b = append(b, es.currencyPositivePrefix[j])
  262. }
  263. if num < 0 {
  264. b = append(b, es.minus[0])
  265. }
  266. // reverse
  267. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  268. b[i], b[j] = b[j], b[i]
  269. }
  270. if int(v) < 2 {
  271. if v == 0 {
  272. b = append(b, es.decimal...)
  273. }
  274. for i := 0; i < 2-int(v); i++ {
  275. b = append(b, '0')
  276. }
  277. }
  278. return string(b)
  279. }
  280. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_UY'
  281. // in accounting notation.
  282. func (es *es_UY) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  283. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  284. symbol := es.currencies[currency]
  285. l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
  286. count := 0
  287. inWhole := v == 0
  288. b := make([]byte, 0, l)
  289. for i := len(s) - 1; i >= 0; i-- {
  290. if s[i] == '.' {
  291. b = append(b, es.decimal[0])
  292. inWhole = true
  293. continue
  294. }
  295. if inWhole {
  296. if count == 3 {
  297. b = append(b, es.group[0])
  298. count = 1
  299. } else {
  300. count++
  301. }
  302. }
  303. b = append(b, s[i])
  304. }
  305. if num < 0 {
  306. for j := len(symbol) - 1; j >= 0; j-- {
  307. b = append(b, symbol[j])
  308. }
  309. for j := len(es.currencyNegativePrefix) - 1; j >= 0; j-- {
  310. b = append(b, es.currencyNegativePrefix[j])
  311. }
  312. } else {
  313. for j := len(symbol) - 1; j >= 0; j-- {
  314. b = append(b, symbol[j])
  315. }
  316. for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
  317. b = append(b, es.currencyPositivePrefix[j])
  318. }
  319. }
  320. // reverse
  321. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  322. b[i], b[j] = b[j], b[i]
  323. }
  324. if int(v) < 2 {
  325. if v == 0 {
  326. b = append(b, es.decimal...)
  327. }
  328. for i := 0; i < 2-int(v); i++ {
  329. b = append(b, '0')
  330. }
  331. }
  332. if num < 0 {
  333. b = append(b, es.currencyNegativeSuffix...)
  334. }
  335. return string(b)
  336. }
  337. // FmtDateShort returns the short date representation of 't' for 'es_UY'
  338. func (es *es_UY) FmtDateShort(t time.Time) string {
  339. b := make([]byte, 0, 32)
  340. b = strconv.AppendInt(b, int64(t.Day()), 10)
  341. b = append(b, []byte{0x2f}...)
  342. b = strconv.AppendInt(b, int64(t.Month()), 10)
  343. b = append(b, []byte{0x2f}...)
  344. if t.Year() > 9 {
  345. b = append(b, strconv.Itoa(t.Year())[2:]...)
  346. } else {
  347. b = append(b, strconv.Itoa(t.Year())[1:]...)
  348. }
  349. return string(b)
  350. }
  351. // FmtDateMedium returns the medium date representation of 't' for 'es_UY'
  352. func (es *es_UY) FmtDateMedium(t time.Time) string {
  353. b := make([]byte, 0, 32)
  354. b = strconv.AppendInt(b, int64(t.Day()), 10)
  355. b = append(b, []byte{0x20}...)
  356. b = append(b, es.monthsAbbreviated[t.Month()]...)
  357. b = append(b, []byte{0x20}...)
  358. if t.Year() > 0 {
  359. b = strconv.AppendInt(b, int64(t.Year()), 10)
  360. } else {
  361. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  362. }
  363. return string(b)
  364. }
  365. // FmtDateLong returns the long date representation of 't' for 'es_UY'
  366. func (es *es_UY) FmtDateLong(t time.Time) string {
  367. b := make([]byte, 0, 32)
  368. b = strconv.AppendInt(b, int64(t.Day()), 10)
  369. b = append(b, []byte{0x20, 0x64, 0x65}...)
  370. b = append(b, []byte{0x20}...)
  371. b = append(b, es.monthsWide[t.Month()]...)
  372. b = append(b, []byte{0x20, 0x64, 0x65}...)
  373. b = append(b, []byte{0x20}...)
  374. if t.Year() > 0 {
  375. b = strconv.AppendInt(b, int64(t.Year()), 10)
  376. } else {
  377. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  378. }
  379. return string(b)
  380. }
  381. // FmtDateFull returns the full date representation of 't' for 'es_UY'
  382. func (es *es_UY) FmtDateFull(t time.Time) string {
  383. b := make([]byte, 0, 32)
  384. b = append(b, es.daysWide[t.Weekday()]...)
  385. b = append(b, []byte{0x2c, 0x20}...)
  386. b = strconv.AppendInt(b, int64(t.Day()), 10)
  387. b = append(b, []byte{0x20, 0x64, 0x65}...)
  388. b = append(b, []byte{0x20}...)
  389. b = append(b, es.monthsWide[t.Month()]...)
  390. b = append(b, []byte{0x20, 0x64, 0x65}...)
  391. b = append(b, []byte{0x20}...)
  392. if t.Year() > 0 {
  393. b = strconv.AppendInt(b, int64(t.Year()), 10)
  394. } else {
  395. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  396. }
  397. return string(b)
  398. }
  399. // FmtTimeShort returns the short time representation of 't' for 'es_UY'
  400. func (es *es_UY) FmtTimeShort(t time.Time) string {
  401. b := make([]byte, 0, 32)
  402. if t.Hour() < 10 {
  403. b = append(b, '0')
  404. }
  405. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  406. b = append(b, es.timeSeparator...)
  407. if t.Minute() < 10 {
  408. b = append(b, '0')
  409. }
  410. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  411. return string(b)
  412. }
  413. // FmtTimeMedium returns the medium time representation of 't' for 'es_UY'
  414. func (es *es_UY) FmtTimeMedium(t time.Time) string {
  415. b := make([]byte, 0, 32)
  416. if t.Hour() < 10 {
  417. b = append(b, '0')
  418. }
  419. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  420. b = append(b, es.timeSeparator...)
  421. if t.Minute() < 10 {
  422. b = append(b, '0')
  423. }
  424. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  425. b = append(b, es.timeSeparator...)
  426. if t.Second() < 10 {
  427. b = append(b, '0')
  428. }
  429. b = strconv.AppendInt(b, int64(t.Second()), 10)
  430. return string(b)
  431. }
  432. // FmtTimeLong returns the long time representation of 't' for 'es_UY'
  433. func (es *es_UY) FmtTimeLong(t time.Time) string {
  434. b := make([]byte, 0, 32)
  435. if t.Hour() < 10 {
  436. b = append(b, '0')
  437. }
  438. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  439. b = append(b, es.timeSeparator...)
  440. if t.Minute() < 10 {
  441. b = append(b, '0')
  442. }
  443. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  444. b = append(b, es.timeSeparator...)
  445. if t.Second() < 10 {
  446. b = append(b, '0')
  447. }
  448. b = strconv.AppendInt(b, int64(t.Second()), 10)
  449. b = append(b, []byte{0x20}...)
  450. tz, _ := t.Zone()
  451. b = append(b, tz...)
  452. return string(b)
  453. }
  454. // FmtTimeFull returns the full time representation of 't' for 'es_UY'
  455. func (es *es_UY) FmtTimeFull(t time.Time) string {
  456. b := make([]byte, 0, 32)
  457. if t.Hour() < 10 {
  458. b = append(b, '0')
  459. }
  460. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  461. b = append(b, es.timeSeparator...)
  462. if t.Minute() < 10 {
  463. b = append(b, '0')
  464. }
  465. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  466. b = append(b, es.timeSeparator...)
  467. if t.Second() < 10 {
  468. b = append(b, '0')
  469. }
  470. b = strconv.AppendInt(b, int64(t.Second()), 10)
  471. b = append(b, []byte{0x20}...)
  472. tz, _ := t.Zone()
  473. if btz, ok := es.timezones[tz]; ok {
  474. b = append(b, btz...)
  475. } else {
  476. b = append(b, tz...)
  477. }
  478. return string(b)
  479. }