eu_ES.go 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633
  1. package eu_ES
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type eu_ES 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. percentPrefix string
  19. perMille string
  20. timeSeparator string
  21. inifinity string
  22. currencies []string // idx = enum of currency code
  23. currencyPositiveSuffix 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 'eu_ES' locale
  43. func New() locales.Translator {
  44. return &eu_ES{
  45. locale: "eu_ES",
  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", "USD", "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. percentPrefix: " ",
  58. currencyPositiveSuffix: " ",
  59. currencyNegativePrefix: "(",
  60. currencyNegativeSuffix: " )",
  61. monthsAbbreviated: []string{"", "urt.", "ots.", "mar.", "api.", "mai.", "eka.", "uzt.", "abu.", "ira.", "urr.", "aza.", "abe."},
  62. monthsNarrow: []string{"", "U", "O", "M", "A", "M", "E", "U", "A", "I", "U", "A", "A"},
  63. monthsWide: []string{"", "urtarrila", "otsaila", "martxoa", "apirila", "maiatza", "ekaina", "uztaila", "abuztua", "iraila", "urria", "azaroa", "abendua"},
  64. daysAbbreviated: []string{"ig.", "al.", "ar.", "az.", "og.", "or.", "lr."},
  65. daysNarrow: []string{"I", "A", "A", "A", "O", "O", "L"},
  66. daysShort: []string{"ig.", "al.", "ar.", "az.", "og.", "or.", "lr."},
  67. daysWide: []string{"igandea", "astelehena", "asteartea", "asteazkena", "osteguna", "ostirala", "larunbata"},
  68. periodsAbbreviated: []string{"AM", "PM"},
  69. periodsNarrow: []string{"g", "a"},
  70. periodsWide: []string{"AM", "PM"},
  71. erasAbbreviated: []string{"K.a.", "K.o."},
  72. erasNarrow: []string{"", ""},
  73. erasWide: []string{"K.a.", "Kristo ondoren"},
  74. timezones: map[string]string{"HNOG": "Groenlandiako mendebaldeko ordu estandarra", "VET": "Venezuelako ordua", "SRT": "Surinamgo ordua", "PDT": "Ipar Amerikako Pazifikoko udako ordua", "MST": "Ipar Amerikako mendialdeko ordu estandarra", "MDT": "Ipar Amerikako mendialdeko udako ordua", "COT": "Kolonbiako ordu estandarra", "WAT": "Afrikako mendebaldeko ordu estandarra", "AKDT": "Alaskako udako ordua", "NZST": "Zeelanda Berriko ordu estandarra", "MEZ": "Europako erdialdeko ordu estandarra", "IST": "Indiako ordua", "∅∅∅": "Amazoniako udako ordua", "HNCU": "Kubako ordu estandarra", "HNPMX": "Mexikoko Pazifikoko ordu estandarra", "AST": "Ipar Amerikako Atlantikoko ordu estandarra", "BOT": "Boliviako ordua", "HEEG": "Groenlandiako ekialdeko udako ordua", "WARST": "Argentina mendebaldeko udako ordua", "ARST": "Argentinako udako ordua", "CST": "Ipar Amerikako erdialdeko ordu estandarra", "HEPMX": "Mexikoko Pazifikoko udako ordua", "AKST": "Alaskako ordu estandarra", "TMST": "Turkmenistango udako ordua", "HENOMX": "Mexikoko ipar-ekialdeko udako ordua", "OEZ": "Europako ekialdeko ordu estandarra", "JDT": "Japoniako udako ordua", "HNNOMX": "Mexikoko ipar-ekialdeko ordu estandarra", "WART": "Argentina mendebaldeko ordu estandarra", "WITA": "Indonesiako erdialdeko ordua", "WIB": "Indonesiako mendebaldeko ordua", "EDT": "Ipar Amerikako ekialdeko udako ordua", "HNEG": "Groenlandiako ekialdeko ordu estandarra", "LHDT": "Lord Howeko udako ordua", "OESZ": "Europako ekialdeko udako ordua", "HADT": "Hawaii-Aleutiar uharteetako udako ordua", "UYST": "Uruguaiko udako ordua", "HKT": "Hong Kongo ordu estandarra", "HAT": "Ternuako udako ordua", "CAT": "Afrikako erdialdeko ordua", "ADT": "Ipar Amerikako Atlantikoko udako ordua", "SGT": "Singapurreko ordu estandarra", "MESZ": "Europako erdialdeko udako ordua", "LHST": "Lord Howeko ordu estandarra", "HNT": "Ternuako ordu estandarra", "WAST": "Afrikako mendebaldeko udako ordua", "ACST": "Australiako erdialdeko ordu estandarra", "ACWST": "Australiako erdi-mendebaldeko ordu estandarra", "AEST": "Australiako ekialdeko ordu estandarra", "HEOG": "Groenlandiako mendebaldeko udako ordua", "CLST": "Txileko udako ordua", "TMT": "Turkmenistango ordu estandarra", "CHADT": "Chathamgo udako ordua", "HECU": "Kubako udako ordua", "AWST": "Australiako mendebaldeko ordu estandarra", "HEPM": "Saint-Pierre eta Mikeluneko udako ordua", "EAT": "Afrikako ekialdeko ordua", "CLT": "Txileko ordu estandarra", "GMT": "Greenwichko meridianoaren ordua", "MYT": "Malaysiako ordua", "HKST": "Hong Kongo udako ordua", "ART": "Argentinako ordu estandarra", "EST": "Ipar Amerikako ekialdeko ordu estandarra", "WIT": "Indonesiako ekialdeko ordua", "AEDT": "Australiako ekialdeko udako ordua", "BT": "Bhutango ordua", "GFT": "Guyana Frantseseko ordua", "ACDT": "Australiako erdialdeko udako ordua", "ACWDT": "Australiako erdi-mendebaldeko udako ordua", "HAST": "Hawaii-Aleutiar uharteetako ordu estandarra", "ChST": "Chamorroko ordu estandarra", "CHAST": "Chathamgo ordu estandarra", "CDT": "Ipar Amerikako erdialdeko udako ordua", "WEZ": "Europako mendebaldeko ordu estandarra", "NZDT": "Zeelanda Berriko udako ordua", "JST": "Japoniako ordu estandarra", "ECT": "Ekuadorreko ordua", "COST": "Kolonbiako udako ordua", "GYT": "Guyanako ordua", "UYT": "Uruguaiko ordu estandarra", "HNPM": "Saint-Pierre eta Mikeluneko ordu estandarra", "WESZ": "Europako mendebaldeko udako ordua", "PST": "Ipar Amerikako Pazifikoko ordu estandarra", "AWDT": "Australiako mendebaldeko udako ordua", "SAST": "Afrikako hegoaldeko ordua"},
  75. }
  76. }
  77. // Locale returns the current translators string locale
  78. func (eu *eu_ES) Locale() string {
  79. return eu.locale
  80. }
  81. // PluralsCardinal returns the list of cardinal plural rules associated with 'eu_ES'
  82. func (eu *eu_ES) PluralsCardinal() []locales.PluralRule {
  83. return eu.pluralsCardinal
  84. }
  85. // PluralsOrdinal returns the list of ordinal plural rules associated with 'eu_ES'
  86. func (eu *eu_ES) PluralsOrdinal() []locales.PluralRule {
  87. return eu.pluralsOrdinal
  88. }
  89. // PluralsRange returns the list of range plural rules associated with 'eu_ES'
  90. func (eu *eu_ES) PluralsRange() []locales.PluralRule {
  91. return eu.pluralsRange
  92. }
  93. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'eu_ES'
  94. func (eu *eu_ES) 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 'eu_ES'
  102. func (eu *eu_ES) 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 'eu_ES'
  106. func (eu *eu_ES) 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 (eu *eu_ES) MonthAbbreviated(month time.Month) string {
  111. return eu.monthsAbbreviated[month]
  112. }
  113. // MonthsAbbreviated returns the locales abbreviated months
  114. func (eu *eu_ES) MonthsAbbreviated() []string {
  115. return eu.monthsAbbreviated[1:]
  116. }
  117. // MonthNarrow returns the locales narrow month given the 'month' provided
  118. func (eu *eu_ES) MonthNarrow(month time.Month) string {
  119. return eu.monthsNarrow[month]
  120. }
  121. // MonthsNarrow returns the locales narrow months
  122. func (eu *eu_ES) MonthsNarrow() []string {
  123. return eu.monthsNarrow[1:]
  124. }
  125. // MonthWide returns the locales wide month given the 'month' provided
  126. func (eu *eu_ES) MonthWide(month time.Month) string {
  127. return eu.monthsWide[month]
  128. }
  129. // MonthsWide returns the locales wide months
  130. func (eu *eu_ES) MonthsWide() []string {
  131. return eu.monthsWide[1:]
  132. }
  133. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  134. func (eu *eu_ES) WeekdayAbbreviated(weekday time.Weekday) string {
  135. return eu.daysAbbreviated[weekday]
  136. }
  137. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  138. func (eu *eu_ES) WeekdaysAbbreviated() []string {
  139. return eu.daysAbbreviated
  140. }
  141. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  142. func (eu *eu_ES) WeekdayNarrow(weekday time.Weekday) string {
  143. return eu.daysNarrow[weekday]
  144. }
  145. // WeekdaysNarrow returns the locales narrow weekdays
  146. func (eu *eu_ES) WeekdaysNarrow() []string {
  147. return eu.daysNarrow
  148. }
  149. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  150. func (eu *eu_ES) WeekdayShort(weekday time.Weekday) string {
  151. return eu.daysShort[weekday]
  152. }
  153. // WeekdaysShort returns the locales short weekdays
  154. func (eu *eu_ES) WeekdaysShort() []string {
  155. return eu.daysShort
  156. }
  157. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  158. func (eu *eu_ES) WeekdayWide(weekday time.Weekday) string {
  159. return eu.daysWide[weekday]
  160. }
  161. // WeekdaysWide returns the locales wide weekdays
  162. func (eu *eu_ES) WeekdaysWide() []string {
  163. return eu.daysWide
  164. }
  165. // Decimal returns the decimal point of number
  166. func (eu *eu_ES) Decimal() string {
  167. return eu.decimal
  168. }
  169. // Group returns the group of number
  170. func (eu *eu_ES) Group() string {
  171. return eu.group
  172. }
  173. // Group returns the minus sign of number
  174. func (eu *eu_ES) Minus() string {
  175. return eu.minus
  176. }
  177. // FmtNumber returns 'num' with digits/precision of 'v' for 'eu_ES' and handles both Whole and Real numbers based on 'v'
  178. func (eu *eu_ES) FmtNumber(num float64, v uint64) string {
  179. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  180. l := len(s) + 4 + 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, eu.decimal[0])
  187. inWhole = true
  188. continue
  189. }
  190. if inWhole {
  191. if count == 3 {
  192. b = append(b, eu.group[0])
  193. count = 1
  194. } else {
  195. count++
  196. }
  197. }
  198. b = append(b, s[i])
  199. }
  200. if num < 0 {
  201. for j := len(eu.minus) - 1; j >= 0; j-- {
  202. b = append(b, eu.minus[j])
  203. }
  204. }
  205. // reverse
  206. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  207. b[i], b[j] = b[j], b[i]
  208. }
  209. return string(b)
  210. }
  211. // FmtPercent returns 'num' with digits/precision of 'v' for 'eu_ES' and handles both Whole and Real numbers based on 'v'
  212. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  213. func (eu *eu_ES) FmtPercent(num float64, v uint64) string {
  214. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  215. l := len(s) + 7 + 1*len(s[:len(s)-int(v)-1])/3
  216. count := 0
  217. inWhole := v == 0
  218. b := make([]byte, 0, l)
  219. for i := len(s) - 1; i >= 0; i-- {
  220. if s[i] == '.' {
  221. b = append(b, eu.decimal[0])
  222. inWhole = true
  223. continue
  224. }
  225. if inWhole {
  226. if count == 3 {
  227. b = append(b, eu.group[0])
  228. count = 1
  229. } else {
  230. count++
  231. }
  232. }
  233. b = append(b, s[i])
  234. }
  235. if num < 0 {
  236. for j := len(eu.minus) - 1; j >= 0; j-- {
  237. b = append(b, eu.minus[j])
  238. }
  239. }
  240. for j := len(eu.percentPrefix) - 1; j >= 0; j-- {
  241. b = append(b, eu.percentPrefix[j])
  242. }
  243. b = append(b, eu.percent[0])
  244. // reverse
  245. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  246. b[i], b[j] = b[j], b[i]
  247. }
  248. return string(b)
  249. }
  250. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'eu_ES'
  251. func (eu *eu_ES) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  252. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  253. symbol := eu.currencies[currency]
  254. l := len(s) + len(symbol) + 6 + 1*len(s[:len(s)-int(v)-1])/3
  255. count := 0
  256. inWhole := v == 0
  257. b := make([]byte, 0, l)
  258. for i := len(s) - 1; i >= 0; i-- {
  259. if s[i] == '.' {
  260. b = append(b, eu.decimal[0])
  261. inWhole = true
  262. continue
  263. }
  264. if inWhole {
  265. if count == 3 {
  266. b = append(b, eu.group[0])
  267. count = 1
  268. } else {
  269. count++
  270. }
  271. }
  272. b = append(b, s[i])
  273. }
  274. if num < 0 {
  275. for j := len(eu.minus) - 1; j >= 0; j-- {
  276. b = append(b, eu.minus[j])
  277. }
  278. }
  279. // reverse
  280. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  281. b[i], b[j] = b[j], b[i]
  282. }
  283. if int(v) < 2 {
  284. if v == 0 {
  285. b = append(b, eu.decimal...)
  286. }
  287. for i := 0; i < 2-int(v); i++ {
  288. b = append(b, '0')
  289. }
  290. }
  291. b = append(b, eu.currencyPositiveSuffix...)
  292. b = append(b, symbol...)
  293. return string(b)
  294. }
  295. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'eu_ES'
  296. // in accounting notation.
  297. func (eu *eu_ES) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  298. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  299. symbol := eu.currencies[currency]
  300. l := len(s) + len(symbol) + 8 + 1*len(s[:len(s)-int(v)-1])/3
  301. count := 0
  302. inWhole := v == 0
  303. b := make([]byte, 0, l)
  304. for i := len(s) - 1; i >= 0; i-- {
  305. if s[i] == '.' {
  306. b = append(b, eu.decimal[0])
  307. inWhole = true
  308. continue
  309. }
  310. if inWhole {
  311. if count == 3 {
  312. b = append(b, eu.group[0])
  313. count = 1
  314. } else {
  315. count++
  316. }
  317. }
  318. b = append(b, s[i])
  319. }
  320. if num < 0 {
  321. b = append(b, eu.currencyNegativePrefix[0])
  322. }
  323. // reverse
  324. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  325. b[i], b[j] = b[j], b[i]
  326. }
  327. if int(v) < 2 {
  328. if v == 0 {
  329. b = append(b, eu.decimal...)
  330. }
  331. for i := 0; i < 2-int(v); i++ {
  332. b = append(b, '0')
  333. }
  334. }
  335. if num < 0 {
  336. b = append(b, eu.currencyNegativeSuffix...)
  337. b = append(b, symbol...)
  338. } else {
  339. b = append(b, eu.currencyPositiveSuffix...)
  340. b = append(b, symbol...)
  341. }
  342. return string(b)
  343. }
  344. // FmtDateShort returns the short date representation of 't' for 'eu_ES'
  345. func (eu *eu_ES) FmtDateShort(t time.Time) string {
  346. b := make([]byte, 0, 32)
  347. if t.Year() > 9 {
  348. b = append(b, strconv.Itoa(t.Year())[2:]...)
  349. } else {
  350. b = append(b, strconv.Itoa(t.Year())[1:]...)
  351. }
  352. b = append(b, []byte{0x2f}...)
  353. b = strconv.AppendInt(b, int64(t.Month()), 10)
  354. b = append(b, []byte{0x2f}...)
  355. b = strconv.AppendInt(b, int64(t.Day()), 10)
  356. return string(b)
  357. }
  358. // FmtDateMedium returns the medium date representation of 't' for 'eu_ES'
  359. func (eu *eu_ES) FmtDateMedium(t time.Time) string {
  360. b := make([]byte, 0, 32)
  361. if t.Year() > 0 {
  362. b = strconv.AppendInt(b, int64(t.Year()), 10)
  363. } else {
  364. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  365. }
  366. b = append(b, []byte{0x20}...)
  367. b = append(b, eu.monthsAbbreviated[t.Month()]...)
  368. b = append(b, []byte{0x20}...)
  369. b = strconv.AppendInt(b, int64(t.Day()), 10)
  370. return string(b)
  371. }
  372. // FmtDateLong returns the long date representation of 't' for 'eu_ES'
  373. func (eu *eu_ES) FmtDateLong(t time.Time) string {
  374. b := make([]byte, 0, 32)
  375. if t.Year() > 0 {
  376. b = strconv.AppendInt(b, int64(t.Year()), 10)
  377. } else {
  378. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  379. }
  380. b = append(b, []byte{0x28, 0x65}...)
  381. b = append(b, []byte{0x29, 0x6b, 0x6f}...)
  382. b = append(b, []byte{0x20}...)
  383. b = append(b, eu.monthsWide[t.Month()]...)
  384. b = append(b, []byte{0x72, 0x65, 0x6e}...)
  385. b = append(b, []byte{0x20}...)
  386. b = strconv.AppendInt(b, int64(t.Day()), 10)
  387. b = append(b, []byte{0x28, 0x61}...)
  388. b = append(b, []byte{0x29}...)
  389. return string(b)
  390. }
  391. // FmtDateFull returns the full date representation of 't' for 'eu_ES'
  392. func (eu *eu_ES) FmtDateFull(t time.Time) string {
  393. b := make([]byte, 0, 32)
  394. if t.Year() > 0 {
  395. b = strconv.AppendInt(b, int64(t.Year()), 10)
  396. } else {
  397. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  398. }
  399. b = append(b, []byte{0x28, 0x65}...)
  400. b = append(b, []byte{0x29, 0x6b, 0x6f}...)
  401. b = append(b, []byte{0x20}...)
  402. b = append(b, eu.monthsWide[t.Month()]...)
  403. b = append(b, []byte{0x72, 0x65, 0x6e}...)
  404. b = append(b, []byte{0x20}...)
  405. b = strconv.AppendInt(b, int64(t.Day()), 10)
  406. b = append(b, []byte{0x28, 0x61}...)
  407. b = append(b, []byte{0x29, 0x2c, 0x20}...)
  408. b = append(b, eu.daysWide[t.Weekday()]...)
  409. return string(b)
  410. }
  411. // FmtTimeShort returns the short time representation of 't' for 'eu_ES'
  412. func (eu *eu_ES) FmtTimeShort(t time.Time) string {
  413. b := make([]byte, 0, 32)
  414. if t.Hour() < 10 {
  415. b = append(b, '0')
  416. }
  417. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  418. b = append(b, eu.timeSeparator...)
  419. if t.Minute() < 10 {
  420. b = append(b, '0')
  421. }
  422. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  423. return string(b)
  424. }
  425. // FmtTimeMedium returns the medium time representation of 't' for 'eu_ES'
  426. func (eu *eu_ES) FmtTimeMedium(t time.Time) string {
  427. b := make([]byte, 0, 32)
  428. if t.Hour() < 10 {
  429. b = append(b, '0')
  430. }
  431. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  432. b = append(b, eu.timeSeparator...)
  433. if t.Minute() < 10 {
  434. b = append(b, '0')
  435. }
  436. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  437. b = append(b, eu.timeSeparator...)
  438. if t.Second() < 10 {
  439. b = append(b, '0')
  440. }
  441. b = strconv.AppendInt(b, int64(t.Second()), 10)
  442. return string(b)
  443. }
  444. // FmtTimeLong returns the long time representation of 't' for 'eu_ES'
  445. func (eu *eu_ES) FmtTimeLong(t time.Time) string {
  446. b := make([]byte, 0, 32)
  447. if t.Hour() < 10 {
  448. b = append(b, '0')
  449. }
  450. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  451. b = append(b, eu.timeSeparator...)
  452. if t.Minute() < 10 {
  453. b = append(b, '0')
  454. }
  455. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  456. b = append(b, eu.timeSeparator...)
  457. if t.Second() < 10 {
  458. b = append(b, '0')
  459. }
  460. b = strconv.AppendInt(b, int64(t.Second()), 10)
  461. b = append(b, []byte{0x20, 0x28}...)
  462. tz, _ := t.Zone()
  463. b = append(b, tz...)
  464. b = append(b, []byte{0x29}...)
  465. return string(b)
  466. }
  467. // FmtTimeFull returns the full time representation of 't' for 'eu_ES'
  468. func (eu *eu_ES) FmtTimeFull(t time.Time) string {
  469. b := make([]byte, 0, 32)
  470. if t.Hour() < 10 {
  471. b = append(b, '0')
  472. }
  473. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  474. b = append(b, eu.timeSeparator...)
  475. if t.Minute() < 10 {
  476. b = append(b, '0')
  477. }
  478. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  479. b = append(b, eu.timeSeparator...)
  480. if t.Second() < 10 {
  481. b = append(b, '0')
  482. }
  483. b = strconv.AppendInt(b, int64(t.Second()), 10)
  484. b = append(b, []byte{0x20, 0x28}...)
  485. tz, _ := t.Zone()
  486. if btz, ok := eu.timezones[tz]; ok {
  487. b = append(b, btz...)
  488. } else {
  489. b = append(b, tz...)
  490. }
  491. b = append(b, []byte{0x29}...)
  492. return string(b)
  493. }