en_AT.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632
  1. package en_AT
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type en_AT 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. monthsAbbreviated []string
  26. monthsNarrow []string
  27. monthsWide []string
  28. daysAbbreviated []string
  29. daysNarrow []string
  30. daysShort []string
  31. daysWide []string
  32. periodsAbbreviated []string
  33. periodsNarrow []string
  34. periodsShort []string
  35. periodsWide []string
  36. erasAbbreviated []string
  37. erasNarrow []string
  38. erasWide []string
  39. timezones map[string]string
  40. }
  41. // New returns a new instance of translator for the 'en_AT' locale
  42. func New() locales.Translator {
  43. return &en_AT{
  44. locale: "en_AT",
  45. pluralsCardinal: []locales.PluralRule{2, 6},
  46. pluralsOrdinal: []locales.PluralRule{2, 3, 4, 6},
  47. pluralsRange: []locales.PluralRule{6},
  48. decimal: ".",
  49. group: ",",
  50. minus: "-",
  51. percent: "%",
  52. perMille: "‰",
  53. timeSeparator: ":",
  54. inifinity: "∞",
  55. 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 ", "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 ", "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 "},
  56. percentSuffix: " ",
  57. currencyPositivePrefix: " ",
  58. currencyNegativePrefix: " ",
  59. monthsAbbreviated: []string{"", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"},
  60. monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
  61. monthsWide: []string{"", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"},
  62. daysAbbreviated: []string{"Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"},
  63. daysNarrow: []string{"S", "M", "T", "W", "T", "F", "S"},
  64. daysShort: []string{"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"},
  65. daysWide: []string{"Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"},
  66. periodsAbbreviated: []string{"am", "pm"},
  67. periodsNarrow: []string{"a", "p"},
  68. periodsWide: []string{"am", "pm"},
  69. erasAbbreviated: []string{"BC", "AD"},
  70. erasNarrow: []string{"B", "A"},
  71. erasWide: []string{"Before Christ", "Anno Domini"},
  72. timezones: map[string]string{"AWDT": "Australian Western Daylight Time", "AEDT": "Australian Eastern Daylight Time", "EST": "Eastern Standard Time", "EAT": "East Africa Time", "AKDT": "Alaska Daylight Time", "JST": "Japan Standard Time", "SRT": "Suriname Time", "UYST": "Uruguay Summer Time", "EDT": "Eastern Daylight Time", "SAST": "South Africa Standard Time", "WAST": "West Africa Summer Time", "∅∅∅": "Amazon Summer Time", "ART": "Argentina Standard Time", "WIB": "Western Indonesia Time", "IST": "India Standard Time", "HKST": "Hong Kong Summer Time", "WIT": "Eastern Indonesia Time", "TMST": "Turkmenistan Summer Time", "HADT": "Hawaii-Aleutian Daylight Time", "WARST": "Western Argentina Summer Time", "MST": "Macau Standard Time", "AST": "Atlantic Standard Time", "BT": "Bhutan Time", "HAT": "Newfoundland Daylight Time", "ARST": "Argentina Summer Time", "AEST": "Australian Eastern Standard Time", "LHDT": "Lord Howe Daylight Time", "UYT": "Uruguay Standard Time", "CST": "Central Standard Time", "ACWST": "Australian Central Western Standard Time", "GMT": "Greenwich Mean Time", "MYT": "Malaysia Time", "JDT": "Japan Daylight Time", "ChST": "Chamorro Standard Time", "ACST": "Australian Central Standard Time", "AKST": "Alaska Standard Time", "CAT": "Central Africa Time", "HAST": "Hawaii-Aleutian Standard Time", "SGT": "Singapore Standard Time", "WAT": "West Africa Standard Time", "MDT": "Macau Summer Time", "PDT": "Pacific Daylight Time", "CDT": "Central Daylight Time", "BOT": "Bolivia Time", "CHAST": "Chatham Standard Time", "COT": "Colombia Standard Time", "ECT": "Ecuador Time", "ADT": "Atlantic Daylight Time", "TMT": "Turkmenistan Standard Time", "LHST": "Lord Howe Standard Time", "WITA": "Central Indonesia Time", "CLT": "Chile Standard Time", "WESZ": "Western European Summer Time", "GYT": "Guyana Time", "CHADT": "Chatham Daylight Time", "WEZ": "Western European Standard Time", "CLST": "Chile Summer Time", "OEZ": "Eastern European Standard Time", "OESZ": "Eastern European Summer Time", "HNT": "Newfoundland Standard Time", "MEZ": "Central European Standard Time", "MESZ": "Central European Summer Time", "GFT": "French Guiana Time", "PST": "Pacific Standard Time", "NZDT": "New Zealand Daylight Time", "ACWDT": "Australian Central Western Daylight Time", "HKT": "Hong Kong Standard Time", "NZST": "New Zealand Standard Time", "VET": "Venezuela Time", "COST": "Colombia Summer Time", "WART": "Western Argentina Standard Time", "ACDT": "Australian Central Daylight Time", "AWST": "Australian Western Standard Time"},
  73. }
  74. }
  75. // Locale returns the current translators string locale
  76. func (en *en_AT) Locale() string {
  77. return en.locale
  78. }
  79. // PluralsCardinal returns the list of cardinal plural rules associated with 'en_AT'
  80. func (en *en_AT) PluralsCardinal() []locales.PluralRule {
  81. return en.pluralsCardinal
  82. }
  83. // PluralsOrdinal returns the list of ordinal plural rules associated with 'en_AT'
  84. func (en *en_AT) PluralsOrdinal() []locales.PluralRule {
  85. return en.pluralsOrdinal
  86. }
  87. // PluralsRange returns the list of range plural rules associated with 'en_AT'
  88. func (en *en_AT) PluralsRange() []locales.PluralRule {
  89. return en.pluralsRange
  90. }
  91. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'en_AT'
  92. func (en *en_AT) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  93. n := math.Abs(num)
  94. i := int64(n)
  95. if i == 1 && v == 0 {
  96. return locales.PluralRuleOne
  97. }
  98. return locales.PluralRuleOther
  99. }
  100. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'en_AT'
  101. func (en *en_AT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  102. n := math.Abs(num)
  103. nMod10 := math.Mod(n, 10)
  104. nMod100 := math.Mod(n, 100)
  105. if nMod10 == 1 && nMod100 != 11 {
  106. return locales.PluralRuleOne
  107. } else if nMod10 == 2 && nMod100 != 12 {
  108. return locales.PluralRuleTwo
  109. } else if nMod10 == 3 && nMod100 != 13 {
  110. return locales.PluralRuleFew
  111. }
  112. return locales.PluralRuleOther
  113. }
  114. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'en_AT'
  115. func (en *en_AT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  116. return locales.PluralRuleOther
  117. }
  118. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  119. func (en *en_AT) MonthAbbreviated(month time.Month) string {
  120. return en.monthsAbbreviated[month]
  121. }
  122. // MonthsAbbreviated returns the locales abbreviated months
  123. func (en *en_AT) MonthsAbbreviated() []string {
  124. return en.monthsAbbreviated[1:]
  125. }
  126. // MonthNarrow returns the locales narrow month given the 'month' provided
  127. func (en *en_AT) MonthNarrow(month time.Month) string {
  128. return en.monthsNarrow[month]
  129. }
  130. // MonthsNarrow returns the locales narrow months
  131. func (en *en_AT) MonthsNarrow() []string {
  132. return en.monthsNarrow[1:]
  133. }
  134. // MonthWide returns the locales wide month given the 'month' provided
  135. func (en *en_AT) MonthWide(month time.Month) string {
  136. return en.monthsWide[month]
  137. }
  138. // MonthsWide returns the locales wide months
  139. func (en *en_AT) MonthsWide() []string {
  140. return en.monthsWide[1:]
  141. }
  142. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  143. func (en *en_AT) WeekdayAbbreviated(weekday time.Weekday) string {
  144. return en.daysAbbreviated[weekday]
  145. }
  146. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  147. func (en *en_AT) WeekdaysAbbreviated() []string {
  148. return en.daysAbbreviated
  149. }
  150. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  151. func (en *en_AT) WeekdayNarrow(weekday time.Weekday) string {
  152. return en.daysNarrow[weekday]
  153. }
  154. // WeekdaysNarrow returns the locales narrow weekdays
  155. func (en *en_AT) WeekdaysNarrow() []string {
  156. return en.daysNarrow
  157. }
  158. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  159. func (en *en_AT) WeekdayShort(weekday time.Weekday) string {
  160. return en.daysShort[weekday]
  161. }
  162. // WeekdaysShort returns the locales short weekdays
  163. func (en *en_AT) WeekdaysShort() []string {
  164. return en.daysShort
  165. }
  166. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  167. func (en *en_AT) WeekdayWide(weekday time.Weekday) string {
  168. return en.daysWide[weekday]
  169. }
  170. // WeekdaysWide returns the locales wide weekdays
  171. func (en *en_AT) WeekdaysWide() []string {
  172. return en.daysWide
  173. }
  174. // FmtNumber returns 'num' with digits/precision of 'v' for 'en_AT' and handles both Whole and Real numbers based on 'v'
  175. func (en *en_AT) FmtNumber(num float64, v uint64) string {
  176. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  177. l := len(s) + 2 + 1*len(s[:len(s)-int(v)-1])/3
  178. count := 0
  179. inWhole := v == 0
  180. b := make([]byte, 0, l)
  181. for i := len(s) - 1; i >= 0; i-- {
  182. if s[i] == '.' {
  183. b = append(b, en.decimal[0])
  184. inWhole = true
  185. continue
  186. }
  187. if inWhole {
  188. if count == 3 {
  189. b = append(b, en.group[0])
  190. count = 1
  191. } else {
  192. count++
  193. }
  194. }
  195. b = append(b, s[i])
  196. }
  197. if num < 0 {
  198. b = append(b, en.minus[0])
  199. }
  200. // reverse
  201. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  202. b[i], b[j] = b[j], b[i]
  203. }
  204. return string(b)
  205. }
  206. // FmtPercent returns 'num' with digits/precision of 'v' for 'en_AT' and handles both Whole and Real numbers based on 'v'
  207. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  208. func (en *en_AT) FmtPercent(num float64, v uint64) string {
  209. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  210. l := len(s) + 5
  211. b := make([]byte, 0, l)
  212. for i := len(s) - 1; i >= 0; i-- {
  213. if s[i] == '.' {
  214. b = append(b, en.decimal[0])
  215. continue
  216. }
  217. b = append(b, s[i])
  218. }
  219. if num < 0 {
  220. b = append(b, en.minus[0])
  221. }
  222. // reverse
  223. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  224. b[i], b[j] = b[j], b[i]
  225. }
  226. b = append(b, en.percentSuffix...)
  227. b = append(b, en.percent...)
  228. return string(b)
  229. }
  230. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'en_AT'
  231. func (en *en_AT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  232. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  233. symbol := en.currencies[currency]
  234. l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
  235. count := 0
  236. inWhole := v == 0
  237. b := make([]byte, 0, l)
  238. for i := len(s) - 1; i >= 0; i-- {
  239. if s[i] == '.' {
  240. b = append(b, en.decimal[0])
  241. inWhole = true
  242. continue
  243. }
  244. if inWhole {
  245. if count == 3 {
  246. b = append(b, en.group[0])
  247. count = 1
  248. } else {
  249. count++
  250. }
  251. }
  252. b = append(b, s[i])
  253. }
  254. for j := len(symbol) - 1; j >= 0; j-- {
  255. b = append(b, symbol[j])
  256. }
  257. for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
  258. b = append(b, en.currencyPositivePrefix[j])
  259. }
  260. if num < 0 {
  261. b = append(b, en.minus[0])
  262. }
  263. // reverse
  264. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  265. b[i], b[j] = b[j], b[i]
  266. }
  267. if int(v) < 2 {
  268. if v == 0 {
  269. b = append(b, en.decimal...)
  270. }
  271. for i := 0; i < 2-int(v); i++ {
  272. b = append(b, '0')
  273. }
  274. }
  275. return string(b)
  276. }
  277. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'en_AT'
  278. // in accounting notation.
  279. func (en *en_AT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  280. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  281. symbol := en.currencies[currency]
  282. l := len(s) + len(symbol) + 4 + 1*len(s[:len(s)-int(v)-1])/3
  283. count := 0
  284. inWhole := v == 0
  285. b := make([]byte, 0, l)
  286. for i := len(s) - 1; i >= 0; i-- {
  287. if s[i] == '.' {
  288. b = append(b, en.decimal[0])
  289. inWhole = true
  290. continue
  291. }
  292. if inWhole {
  293. if count == 3 {
  294. b = append(b, en.group[0])
  295. count = 1
  296. } else {
  297. count++
  298. }
  299. }
  300. b = append(b, s[i])
  301. }
  302. if num < 0 {
  303. for j := len(symbol) - 1; j >= 0; j-- {
  304. b = append(b, symbol[j])
  305. }
  306. for j := len(en.currencyNegativePrefix) - 1; j >= 0; j-- {
  307. b = append(b, en.currencyNegativePrefix[j])
  308. }
  309. b = append(b, en.minus[0])
  310. } else {
  311. for j := len(symbol) - 1; j >= 0; j-- {
  312. b = append(b, symbol[j])
  313. }
  314. for j := len(en.currencyPositivePrefix) - 1; j >= 0; j-- {
  315. b = append(b, en.currencyPositivePrefix[j])
  316. }
  317. }
  318. // reverse
  319. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  320. b[i], b[j] = b[j], b[i]
  321. }
  322. if int(v) < 2 {
  323. if v == 0 {
  324. b = append(b, en.decimal...)
  325. }
  326. for i := 0; i < 2-int(v); i++ {
  327. b = append(b, '0')
  328. }
  329. }
  330. return string(b)
  331. }
  332. // FmtDateShort returns the short date representation of 't' for 'en_AT'
  333. func (en *en_AT) FmtDateShort(t time.Time) string {
  334. b := make([]byte, 0, 32)
  335. b = strconv.AppendInt(b, int64(t.Month()), 10)
  336. b = append(b, []byte{0x2f}...)
  337. b = strconv.AppendInt(b, int64(t.Day()), 10)
  338. b = append(b, []byte{0x2f}...)
  339. if t.Year() > 9 {
  340. b = append(b, strconv.Itoa(t.Year())[2:]...)
  341. } else {
  342. b = append(b, strconv.Itoa(t.Year())[1:]...)
  343. }
  344. return string(b)
  345. }
  346. // FmtDateMedium returns the medium date representation of 't' for 'en_AT'
  347. func (en *en_AT) FmtDateMedium(t time.Time) string {
  348. b := make([]byte, 0, 32)
  349. b = append(b, en.monthsAbbreviated[t.Month()]...)
  350. b = append(b, []byte{0x20}...)
  351. b = strconv.AppendInt(b, int64(t.Day()), 10)
  352. b = append(b, []byte{0x2c, 0x20}...)
  353. b = strconv.AppendInt(b, int64(t.Year()), 10)
  354. return string(b)
  355. }
  356. // FmtDateLong returns the long date representation of 't' for 'en_AT'
  357. func (en *en_AT) FmtDateLong(t time.Time) string {
  358. b := make([]byte, 0, 32)
  359. b = append(b, en.monthsWide[t.Month()]...)
  360. b = append(b, []byte{0x20}...)
  361. b = strconv.AppendInt(b, int64(t.Day()), 10)
  362. b = append(b, []byte{0x2c, 0x20}...)
  363. b = strconv.AppendInt(b, int64(t.Year()), 10)
  364. return string(b)
  365. }
  366. // FmtDateFull returns the full date representation of 't' for 'en_AT'
  367. func (en *en_AT) FmtDateFull(t time.Time) string {
  368. b := make([]byte, 0, 32)
  369. b = append(b, en.daysWide[t.Weekday()]...)
  370. b = append(b, []byte{0x2c, 0x20}...)
  371. b = append(b, en.monthsWide[t.Month()]...)
  372. b = append(b, []byte{0x20}...)
  373. b = strconv.AppendInt(b, int64(t.Day()), 10)
  374. b = append(b, []byte{0x2c, 0x20}...)
  375. b = strconv.AppendInt(b, int64(t.Year()), 10)
  376. return string(b)
  377. }
  378. // FmtTimeShort returns the short time representation of 't' for 'en_AT'
  379. func (en *en_AT) FmtTimeShort(t time.Time) string {
  380. b := make([]byte, 0, 32)
  381. h := t.Hour()
  382. if h > 12 {
  383. h -= 12
  384. }
  385. b = strconv.AppendInt(b, int64(h), 10)
  386. b = append(b, en.timeSeparator...)
  387. if t.Minute() < 10 {
  388. b = append(b, '0')
  389. }
  390. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  391. b = append(b, []byte{0x20}...)
  392. if t.Hour() < 12 {
  393. b = append(b, en.periodsAbbreviated[0]...)
  394. } else {
  395. b = append(b, en.periodsAbbreviated[1]...)
  396. }
  397. return string(b)
  398. }
  399. // FmtTimeMedium returns the medium time representation of 't' for 'en_AT'
  400. func (en *en_AT) FmtTimeMedium(t time.Time) string {
  401. b := make([]byte, 0, 32)
  402. h := t.Hour()
  403. if h > 12 {
  404. h -= 12
  405. }
  406. b = strconv.AppendInt(b, int64(h), 10)
  407. b = append(b, en.timeSeparator...)
  408. if t.Minute() < 10 {
  409. b = append(b, '0')
  410. }
  411. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  412. b = append(b, en.timeSeparator...)
  413. if t.Second() < 10 {
  414. b = append(b, '0')
  415. }
  416. b = strconv.AppendInt(b, int64(t.Second()), 10)
  417. b = append(b, []byte{0x20}...)
  418. if t.Hour() < 12 {
  419. b = append(b, en.periodsAbbreviated[0]...)
  420. } else {
  421. b = append(b, en.periodsAbbreviated[1]...)
  422. }
  423. return string(b)
  424. }
  425. // FmtTimeLong returns the long time representation of 't' for 'en_AT'
  426. func (en *en_AT) FmtTimeLong(t time.Time) string {
  427. b := make([]byte, 0, 32)
  428. h := t.Hour()
  429. if h > 12 {
  430. h -= 12
  431. }
  432. b = strconv.AppendInt(b, int64(h), 10)
  433. b = append(b, en.timeSeparator...)
  434. if t.Minute() < 10 {
  435. b = append(b, '0')
  436. }
  437. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  438. b = append(b, en.timeSeparator...)
  439. if t.Second() < 10 {
  440. b = append(b, '0')
  441. }
  442. b = strconv.AppendInt(b, int64(t.Second()), 10)
  443. b = append(b, []byte{0x20}...)
  444. if t.Hour() < 12 {
  445. b = append(b, en.periodsAbbreviated[0]...)
  446. } else {
  447. b = append(b, en.periodsAbbreviated[1]...)
  448. }
  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 'en_AT'
  455. func (en *en_AT) FmtTimeFull(t time.Time) string {
  456. b := make([]byte, 0, 32)
  457. h := t.Hour()
  458. if h > 12 {
  459. h -= 12
  460. }
  461. b = strconv.AppendInt(b, int64(h), 10)
  462. b = append(b, en.timeSeparator...)
  463. if t.Minute() < 10 {
  464. b = append(b, '0')
  465. }
  466. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  467. b = append(b, en.timeSeparator...)
  468. if t.Second() < 10 {
  469. b = append(b, '0')
  470. }
  471. b = strconv.AppendInt(b, int64(t.Second()), 10)
  472. b = append(b, []byte{0x20}...)
  473. if t.Hour() < 12 {
  474. b = append(b, en.periodsAbbreviated[0]...)
  475. } else {
  476. b = append(b, en.periodsAbbreviated[1]...)
  477. }
  478. b = append(b, []byte{0x20}...)
  479. tz, _ := t.Zone()
  480. if btz, ok := en.timezones[tz]; ok {
  481. b = append(b, btz...)
  482. } else {
  483. b = append(b, tz...)
  484. }
  485. return string(b)
  486. }