es_AR.go 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574
  1. package es_AR
  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_AR 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_AR' locale
  43. func New() locales.Translator {
  44. return &es_AR{
  45. locale: "es_AR",
  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 ", "$", "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 ", "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 ", "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 "},
  57. percentSuffix: " ",
  58. currencyPositivePrefix: " ",
  59. currencyNegativePrefix: "( ",
  60. currencyNegativeSuffix: ")",
  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", "X", "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{"", ""},
  69. periodsNarrow: []string{"", ""},
  70. periodsWide: []string{"", ""},
  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{"HKST": "hora de verano de Hong Kong", "OESZ": "hora de verano de Europa oriental", "NZST": "hora estándar de Nueva Zelanda", "ECT": "hora de Ecuador", "AKST": "hora estándar de Alaska", "PDT": "hora de verano del Pacífico", "AWDT": "hora de verano de Australia occidental", "MEZ": "hora estándar de Europa central", "CLST": "hora de verano de Chile", "HNT": "hora estándar de Terranova", "GFT": "hora de la Guayana Francesa", "WIT": "hora de Indonesia oriental", "BT": "hora de Bután", "AST": "hora estándar del Atlántico", "HAT": "hora de verano de Terranova", "MESZ": "hora de verano de Europa central", "AEST": "hora estándar de Australia oriental", "CAT": "hora de África central", "ADT": "hora de verano del Atlántico", "WAT": "hora estándar de África occidental", "WITA": "hora de Indonesia central", "LHST": "hora estándar de Lord Howe", "WESZ": "hora de verano de Europa occidental", "∅∅∅": "hora de verano del Amazonas", "CLT": "hora estándar de Chile", "VET": "hora de Venezuela", "AEDT": "hora de verano de Australia oriental", "EST": "hora estándar oriental", "HADT": "hora de verano de Hawái-Aleutiano", "TMT": "hora estándar de Turkmenistán", "CST": "hora estándar central", "CHADT": "hora de verano de Chatham", "MYT": "hora de Malasia", "SRT": "hora de Surinam", "UYT": "hora estándar de Uruguay", "WART": "hora estándar de Argentina occidental", "EAT": "hora de África oriental", "MST": "Hora estándar de Macao", "WEZ": "hora estándar de Europa occidental", "WARST": "hora de verano de Argentina occidental", "GYT": "hora de Guyana", "EDT": "hora de verano oriental", "SGT": "hora de Singapur", "ACDT": "hora de verano de Australia central", "LHDT": "hora de verano de Lord Howe", "AWST": "hora estándar de Australia occidental", "COT": "hora estándar de Colombia", "OEZ": "hora estándar de Europa oriental", "ARST": "hora de verano de Argentina", "ACST": "hora estándar de Australia central", "BOT": "hora de Bolivia", "HAST": "hora estándar de Hawái-Aleutiano", "WIB": "hora de Indonesia occidental", "TMST": "hora de verano de Turkmenistán", "AKDT": "hora de verano de Alaska", "ACWST": "hora estándar de Australia centroccidental", "HKT": "hora estándar de Hong Kong", "IST": "hora estándar de la India", "NZDT": "hora de verano de Nueva Zelanda", "CDT": "hora de verano central", "CHAST": "hora estándar de Chatham", "COST": "hora de verano de Colombia", "SAST": "hora de Sudáfrica", "GMT": "hora del meridiano de Greenwich", "JDT": "hora de verano de Japón", "PST": "hora estándar del Pacífico", "UYST": "hora de verano de Uruguay", "ChST": "hora estándar de Chamorro", "ACWDT": "hora de verano de Australia centroccidental", "WAST": "hora de verano de África occidental", "ART": "hora estándar de Argentina", "MDT": "Hora de verano de Macao", "JST": "hora estándar de Japón"},
  75. }
  76. }
  77. // Locale returns the current translators string locale
  78. func (es *es_AR) Locale() string {
  79. return es.locale
  80. }
  81. // PluralsCardinal returns the list of cardinal plural rules associated with 'es_AR'
  82. func (es *es_AR) PluralsCardinal() []locales.PluralRule {
  83. return es.pluralsCardinal
  84. }
  85. // PluralsOrdinal returns the list of ordinal plural rules associated with 'es_AR'
  86. func (es *es_AR) PluralsOrdinal() []locales.PluralRule {
  87. return es.pluralsOrdinal
  88. }
  89. // PluralsRange returns the list of range plural rules associated with 'es_AR'
  90. func (es *es_AR) PluralsRange() []locales.PluralRule {
  91. return es.pluralsRange
  92. }
  93. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'es_AR'
  94. func (es *es_AR) 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_AR'
  102. func (es *es_AR) 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_AR'
  106. func (es *es_AR) 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_AR) MonthAbbreviated(month time.Month) string {
  111. return es.monthsAbbreviated[month]
  112. }
  113. // MonthsAbbreviated returns the locales abbreviated months
  114. func (es *es_AR) MonthsAbbreviated() []string {
  115. return es.monthsAbbreviated[1:]
  116. }
  117. // MonthNarrow returns the locales narrow month given the 'month' provided
  118. func (es *es_AR) MonthNarrow(month time.Month) string {
  119. return es.monthsNarrow[month]
  120. }
  121. // MonthsNarrow returns the locales narrow months
  122. func (es *es_AR) MonthsNarrow() []string {
  123. return es.monthsNarrow[1:]
  124. }
  125. // MonthWide returns the locales wide month given the 'month' provided
  126. func (es *es_AR) MonthWide(month time.Month) string {
  127. return es.monthsWide[month]
  128. }
  129. // MonthsWide returns the locales wide months
  130. func (es *es_AR) MonthsWide() []string {
  131. return es.monthsWide[1:]
  132. }
  133. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  134. func (es *es_AR) WeekdayAbbreviated(weekday time.Weekday) string {
  135. return es.daysAbbreviated[weekday]
  136. }
  137. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  138. func (es *es_AR) WeekdaysAbbreviated() []string {
  139. return es.daysAbbreviated
  140. }
  141. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  142. func (es *es_AR) WeekdayNarrow(weekday time.Weekday) string {
  143. return es.daysNarrow[weekday]
  144. }
  145. // WeekdaysNarrow returns the locales narrow weekdays
  146. func (es *es_AR) WeekdaysNarrow() []string {
  147. return es.daysNarrow
  148. }
  149. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  150. func (es *es_AR) WeekdayShort(weekday time.Weekday) string {
  151. return es.daysShort[weekday]
  152. }
  153. // WeekdaysShort returns the locales short weekdays
  154. func (es *es_AR) WeekdaysShort() []string {
  155. return es.daysShort
  156. }
  157. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  158. func (es *es_AR) WeekdayWide(weekday time.Weekday) string {
  159. return es.daysWide[weekday]
  160. }
  161. // WeekdaysWide returns the locales wide weekdays
  162. func (es *es_AR) WeekdaysWide() []string {
  163. return es.daysWide
  164. }
  165. // FmtNumber returns 'num' with digits/precision of 'v' for 'es_AR' and handles both Whole and Real numbers based on 'v'
  166. func (es *es_AR) FmtNumber(num float64, v uint64) string {
  167. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  168. l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
  169. count := 0
  170. inWhole := v == 0
  171. b := make([]byte, 0, l)
  172. for i := len(s) - 1; i >= 0; i-- {
  173. if s[i] == '.' {
  174. b = append(b, es.decimal[0])
  175. inWhole = true
  176. continue
  177. }
  178. if inWhole {
  179. if count == 3 {
  180. b = append(b, es.group[0])
  181. count = 1
  182. } else {
  183. count++
  184. }
  185. }
  186. b = append(b, s[i])
  187. }
  188. if num < 0 {
  189. b = append(b, es.minus[0])
  190. }
  191. // reverse
  192. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  193. b[i], b[j] = b[j], b[i]
  194. }
  195. return string(b)
  196. }
  197. // FmtPercent returns 'num' with digits/precision of 'v' for 'es_AR' and handles both Whole and Real numbers based on 'v'
  198. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  199. func (es *es_AR) FmtPercent(num float64, v uint64) string {
  200. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  201. l := len(s) + 5
  202. b := make([]byte, 0, l)
  203. for i := len(s) - 1; i >= 0; i-- {
  204. if s[i] == '.' {
  205. b = append(b, es.decimal[0])
  206. continue
  207. }
  208. b = append(b, s[i])
  209. }
  210. if num < 0 {
  211. b = append(b, es.minus[0])
  212. }
  213. // reverse
  214. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  215. b[i], b[j] = b[j], b[i]
  216. }
  217. b = append(b, es.percentSuffix...)
  218. b = append(b, es.percent...)
  219. return string(b)
  220. }
  221. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'es_AR'
  222. func (es *es_AR) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  223. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  224. symbol := es.currencies[currency]
  225. l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
  226. count := 0
  227. inWhole := v == 0
  228. b := make([]byte, 0, l)
  229. for i := len(s) - 1; i >= 0; i-- {
  230. if s[i] == '.' {
  231. b = append(b, es.decimal[0])
  232. inWhole = true
  233. continue
  234. }
  235. if inWhole {
  236. if count == 3 {
  237. b = append(b, es.group[0])
  238. count = 1
  239. } else {
  240. count++
  241. }
  242. }
  243. b = append(b, s[i])
  244. }
  245. for j := len(symbol) - 1; j >= 0; j-- {
  246. b = append(b, symbol[j])
  247. }
  248. for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
  249. b = append(b, es.currencyPositivePrefix[j])
  250. }
  251. if num < 0 {
  252. b = append(b, es.minus[0])
  253. }
  254. // reverse
  255. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  256. b[i], b[j] = b[j], b[i]
  257. }
  258. if int(v) < 2 {
  259. if v == 0 {
  260. b = append(b, es.decimal...)
  261. }
  262. for i := 0; i < 2-int(v); i++ {
  263. b = append(b, '0')
  264. }
  265. }
  266. return string(b)
  267. }
  268. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'es_AR'
  269. // in accounting notation.
  270. func (es *es_AR) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  271. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  272. symbol := es.currencies[currency]
  273. l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
  274. count := 0
  275. inWhole := v == 0
  276. b := make([]byte, 0, l)
  277. for i := len(s) - 1; i >= 0; i-- {
  278. if s[i] == '.' {
  279. b = append(b, es.decimal[0])
  280. inWhole = true
  281. continue
  282. }
  283. if inWhole {
  284. if count == 3 {
  285. b = append(b, es.group[0])
  286. count = 1
  287. } else {
  288. count++
  289. }
  290. }
  291. b = append(b, s[i])
  292. }
  293. if num < 0 {
  294. for j := len(symbol) - 1; j >= 0; j-- {
  295. b = append(b, symbol[j])
  296. }
  297. for j := len(es.currencyNegativePrefix) - 1; j >= 0; j-- {
  298. b = append(b, es.currencyNegativePrefix[j])
  299. }
  300. } else {
  301. for j := len(symbol) - 1; j >= 0; j-- {
  302. b = append(b, symbol[j])
  303. }
  304. for j := len(es.currencyPositivePrefix) - 1; j >= 0; j-- {
  305. b = append(b, es.currencyPositivePrefix[j])
  306. }
  307. }
  308. // reverse
  309. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  310. b[i], b[j] = b[j], b[i]
  311. }
  312. if int(v) < 2 {
  313. if v == 0 {
  314. b = append(b, es.decimal...)
  315. }
  316. for i := 0; i < 2-int(v); i++ {
  317. b = append(b, '0')
  318. }
  319. }
  320. if num < 0 {
  321. b = append(b, es.currencyNegativeSuffix...)
  322. }
  323. return string(b)
  324. }
  325. // FmtDateShort returns the short date representation of 't' for 'es_AR'
  326. func (es *es_AR) FmtDateShort(t time.Time) string {
  327. b := make([]byte, 0, 32)
  328. b = strconv.AppendInt(b, int64(t.Day()), 10)
  329. b = append(b, []byte{0x2f}...)
  330. b = strconv.AppendInt(b, int64(t.Month()), 10)
  331. b = append(b, []byte{0x2f}...)
  332. if t.Year() > 9 {
  333. b = append(b, strconv.Itoa(t.Year())[2:]...)
  334. } else {
  335. b = append(b, strconv.Itoa(t.Year())[1:]...)
  336. }
  337. return string(b)
  338. }
  339. // FmtDateMedium returns the medium date representation of 't' for 'es_AR'
  340. func (es *es_AR) FmtDateMedium(t time.Time) string {
  341. b := make([]byte, 0, 32)
  342. b = strconv.AppendInt(b, int64(t.Day()), 10)
  343. b = append(b, []byte{0x20}...)
  344. b = append(b, es.monthsAbbreviated[t.Month()]...)
  345. b = append(b, []byte{0x20}...)
  346. b = strconv.AppendInt(b, int64(t.Year()), 10)
  347. return string(b)
  348. }
  349. // FmtDateLong returns the long date representation of 't' for 'es_AR'
  350. func (es *es_AR) FmtDateLong(t time.Time) string {
  351. b := make([]byte, 0, 32)
  352. b = strconv.AppendInt(b, int64(t.Day()), 10)
  353. b = append(b, []byte{}...)
  354. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  355. b = append(b, es.monthsWide[t.Month()]...)
  356. b = append(b, []byte{}...)
  357. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  358. b = strconv.AppendInt(b, int64(t.Year()), 10)
  359. return string(b)
  360. }
  361. // FmtDateFull returns the full date representation of 't' for 'es_AR'
  362. func (es *es_AR) FmtDateFull(t time.Time) string {
  363. b := make([]byte, 0, 32)
  364. b = append(b, es.daysWide[t.Weekday()]...)
  365. b = append(b, []byte{0x2c, 0x20}...)
  366. b = strconv.AppendInt(b, int64(t.Day()), 10)
  367. b = append(b, []byte{}...)
  368. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  369. b = append(b, es.monthsWide[t.Month()]...)
  370. b = append(b, []byte{}...)
  371. b = append(b, []byte{0x27, 0x64, 0x65, 0x27, 0x20}...)
  372. b = strconv.AppendInt(b, int64(t.Year()), 10)
  373. return string(b)
  374. }
  375. // FmtTimeShort returns the short time representation of 't' for 'es_AR'
  376. func (es *es_AR) FmtTimeShort(t time.Time) string {
  377. b := make([]byte, 0, 32)
  378. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  379. b = append(b, es.timeSeparator...)
  380. if t.Minute() < 10 {
  381. b = append(b, '0')
  382. }
  383. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  384. return string(b)
  385. }
  386. // FmtTimeMedium returns the medium time representation of 't' for 'es_AR'
  387. func (es *es_AR) FmtTimeMedium(t time.Time) string {
  388. b := make([]byte, 0, 32)
  389. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  390. b = append(b, es.timeSeparator...)
  391. if t.Minute() < 10 {
  392. b = append(b, '0')
  393. }
  394. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  395. b = append(b, es.timeSeparator...)
  396. if t.Second() < 10 {
  397. b = append(b, '0')
  398. }
  399. b = strconv.AppendInt(b, int64(t.Second()), 10)
  400. return string(b)
  401. }
  402. // FmtTimeLong returns the long time representation of 't' for 'es_AR'
  403. func (es *es_AR) FmtTimeLong(t time.Time) string {
  404. b := make([]byte, 0, 32)
  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. b = append(b, es.timeSeparator...)
  412. if t.Second() < 10 {
  413. b = append(b, '0')
  414. }
  415. b = strconv.AppendInt(b, int64(t.Second()), 10)
  416. b = append(b, []byte{0x20}...)
  417. tz, _ := t.Zone()
  418. b = append(b, tz...)
  419. return string(b)
  420. }
  421. // FmtTimeFull returns the full time representation of 't' for 'es_AR'
  422. func (es *es_AR) FmtTimeFull(t time.Time) string {
  423. b := make([]byte, 0, 32)
  424. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  425. b = append(b, es.timeSeparator...)
  426. if t.Minute() < 10 {
  427. b = append(b, '0')
  428. }
  429. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  430. b = append(b, es.timeSeparator...)
  431. if t.Second() < 10 {
  432. b = append(b, '0')
  433. }
  434. b = strconv.AppendInt(b, int64(t.Second()), 10)
  435. b = append(b, []byte{0x20, 0x28}...)
  436. tz, _ := t.Zone()
  437. if btz, ok := es.timezones[tz]; ok {
  438. b = append(b, btz...)
  439. } else {
  440. b = append(b, tz...)
  441. }
  442. b = append(b, []byte{0x29}...)
  443. return string(b)
  444. }