de_AT.go 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648
  1. package de_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 de_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 'de_AT' locale
  42. func New() locales.Translator {
  43. return &de_AT{
  44. locale: "de_AT",
  45. pluralsCardinal: []locales.PluralRule{2, 6},
  46. pluralsOrdinal: []locales.PluralRule{6},
  47. pluralsRange: []locales.PluralRule{2, 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", "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"},
  56. percentSuffix: " ",
  57. currencyPositivePrefix: " ",
  58. currencyNegativePrefix: " ",
  59. monthsAbbreviated: []string{"", "Jän.", "Feb.", "März", "Apr.", "Mai", "Juni", "Juli", "Aug.", "Sep.", "Okt.", "Nov.", "Dez."},
  60. monthsNarrow: []string{"", "J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"},
  61. monthsWide: []string{"", "Jänner", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"},
  62. daysAbbreviated: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
  63. daysNarrow: []string{"S", "M", "D", "M", "D", "F", "S"},
  64. daysShort: []string{"So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."},
  65. daysWide: []string{"Sonntag", "Montag", "Dienstag", "Mittwoch", "Donnerstag", "Freitag", "Samstag"},
  66. periodsAbbreviated: []string{"vorm.", "nachm."},
  67. periodsNarrow: []string{"vm.", "nm."},
  68. periodsWide: []string{"vorm.", "nachm."},
  69. erasAbbreviated: []string{"v. Chr.", "n. Chr."},
  70. erasNarrow: []string{"v. Chr.", "n. Chr."},
  71. erasWide: []string{"v. Chr.", "n. Chr."},
  72. timezones: map[string]string{"AST": "Atlantik-Normalzeit", "AKST": "Alaska-Normalzeit", "HNOG": "Westgrönland-Normalzeit", "HAT": "Neufundland-Sommerzeit", "WIT": "Ostindonesische Zeit", "TMT": "Turkmenistan-Normalzeit", "GMT": "Mittlere Greenwich-Zeit", "GFT": "Französisch-Guayana-Zeit", "HNCU": "Kubanische Normalzeit", "AEDT": "Ostaustralische Sommerzeit", "WIB": "Westindonesische Zeit", "ChST": "Chamorro-Zeit", "CLT": "Chilenische Normalzeit", "MDT": "Rocky-Mountain-Sommerzeit", "BOT": "Bolivianische Zeit", "TMST": "Turkmenistan-Sommerzeit", "HAST": "Hawaii-Aleuten-Normalzeit", "AWST": "Westaustralische Normalzeit", "MYT": "Malaysische Zeit", "BT": "Bhutan-Zeit", "ACWST": "Zentral-/Westaustralische Normalzeit", "HEOG": "Westgrönland-Sommerzeit", "HECU": "Kubanische Sommerzeit", "SAST": "Südafrikanische Zeit", "NZDT": "Neuseeland-Sommerzeit", "ACST": "Zentralaustralische Normalzeit", "HEEG": "Ostgrönland-Sommerzeit", "UYT": "Uruguyanische Normalzeit", "CHADT": "Chatham-Sommerzeit", "JDT": "Japanische Sommerzeit", "CST": "Nordamerikanische Inland-Normalzeit", "CDT": "Nordamerikanische Inland-Sommerzeit", "WESZ": "Westeuropäische Sommerzeit", "HNEG": "Ostgrönland-Normalzeit", "EST": "Nordamerikanische Ostküsten-Normalzeit", "OESZ": "Osteuropäische Sommerzeit", "CHAST": "Chatham-Normalzeit", "AWDT": "Westaustralische Sommerzeit", "HKST": "Hongkong-Sommerzeit", "MEZ": "Mitteleuropäische Normalzeit", "HEPM": "Saint-Pierre-und-Miquelon-Sommerzeit", "ECT": "Ecuadorianische Zeit", "ACDT": "Zentralaustralische Sommerzeit", "LHDT": "Lord-Howe-Sommerzeit", "HNNOMX": "Mexiko Nordwestliche Zone-Normalzeit", "CLST": "Chilenische Sommerzeit", "ADT": "Atlantik-Sommerzeit", "WAST": "Westafrikanische Sommerzeit", "SGT": "Singapur-Zeit", "LHST": "Lord-Howe-Normalzeit", "WITA": "Zentralindonesische Zeit", "PDT": "Nordamerikanische Westküsten-Sommerzeit", "MST": "Rocky Mountain-Normalzeit", "ACWDT": "Zentral-/Westaustralische Sommerzeit", "JST": "Japanische Normalzeit", "AKDT": "Alaska-Sommerzeit", "EDT": "Nordamerikanische Ostküsten-Sommerzeit", "VET": "Venezuela-Zeit", "HENOMX": "Mexiko Nordwestliche Zone-Sommerzeit", "EAT": "Ostafrikanische Zeit", "OEZ": "Osteuropäische Normalzeit", "PST": "Nordamerikanische Westküsten-Normalzeit", "HADT": "Hawaii-Aleuten-Sommerzeit", "HKT": "Hongkong-Normalzeit", "IST": "Indische Zeit", "HEPMX": "Mexiko Pazifikzone-Sommerzeit", "WAT": "Westafrikanische Normalzeit", "WART": "Westargentinische Normalzeit", "WARST": "Westargentinische Sommerzeit", "HNT": "Neufundland-Normalzeit", "ART": "Argentinische Normalzeit", "ARST": "Argentinische Sommerzeit", "UYST": "Uruguayanische Sommerzeit", "SRT": "Suriname-Zeit", "HNPMX": "Mexiko Pazifikzone-Normalzeit", "NZST": "Neuseeland-Normalzeit", "HNPM": "Saint-Pierre-und-Miquelon-Normalzeit", "COST": "Kolumbianische Sommerzeit", "∅∅∅": "Amazonas-Sommerzeit", "GYT": "Guyana-Zeit", "WEZ": "Westeuropäische Normalzeit", "MESZ": "Mitteleuropäische Sommerzeit", "CAT": "Zentralafrikanische Zeit", "COT": "Kolumbianische Normalzeit", "AEST": "Ostaustralische Normalzeit"},
  73. }
  74. }
  75. // Locale returns the current translators string locale
  76. func (de *de_AT) Locale() string {
  77. return de.locale
  78. }
  79. // PluralsCardinal returns the list of cardinal plural rules associated with 'de_AT'
  80. func (de *de_AT) PluralsCardinal() []locales.PluralRule {
  81. return de.pluralsCardinal
  82. }
  83. // PluralsOrdinal returns the list of ordinal plural rules associated with 'de_AT'
  84. func (de *de_AT) PluralsOrdinal() []locales.PluralRule {
  85. return de.pluralsOrdinal
  86. }
  87. // PluralsRange returns the list of range plural rules associated with 'de_AT'
  88. func (de *de_AT) PluralsRange() []locales.PluralRule {
  89. return de.pluralsRange
  90. }
  91. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'de_AT'
  92. func (de *de_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 'de_AT'
  101. func (de *de_AT) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  102. return locales.PluralRuleOther
  103. }
  104. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'de_AT'
  105. func (de *de_AT) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  106. start := de.CardinalPluralRule(num1, v1)
  107. end := de.CardinalPluralRule(num2, v2)
  108. if start == locales.PluralRuleOne && end == locales.PluralRuleOther {
  109. return locales.PluralRuleOther
  110. } else if start == locales.PluralRuleOther && end == locales.PluralRuleOne {
  111. return locales.PluralRuleOne
  112. }
  113. return locales.PluralRuleOther
  114. }
  115. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  116. func (de *de_AT) MonthAbbreviated(month time.Month) string {
  117. return de.monthsAbbreviated[month]
  118. }
  119. // MonthsAbbreviated returns the locales abbreviated months
  120. func (de *de_AT) MonthsAbbreviated() []string {
  121. return de.monthsAbbreviated[1:]
  122. }
  123. // MonthNarrow returns the locales narrow month given the 'month' provided
  124. func (de *de_AT) MonthNarrow(month time.Month) string {
  125. return de.monthsNarrow[month]
  126. }
  127. // MonthsNarrow returns the locales narrow months
  128. func (de *de_AT) MonthsNarrow() []string {
  129. return de.monthsNarrow[1:]
  130. }
  131. // MonthWide returns the locales wide month given the 'month' provided
  132. func (de *de_AT) MonthWide(month time.Month) string {
  133. return de.monthsWide[month]
  134. }
  135. // MonthsWide returns the locales wide months
  136. func (de *de_AT) MonthsWide() []string {
  137. return de.monthsWide[1:]
  138. }
  139. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  140. func (de *de_AT) WeekdayAbbreviated(weekday time.Weekday) string {
  141. return de.daysAbbreviated[weekday]
  142. }
  143. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  144. func (de *de_AT) WeekdaysAbbreviated() []string {
  145. return de.daysAbbreviated
  146. }
  147. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  148. func (de *de_AT) WeekdayNarrow(weekday time.Weekday) string {
  149. return de.daysNarrow[weekday]
  150. }
  151. // WeekdaysNarrow returns the locales narrow weekdays
  152. func (de *de_AT) WeekdaysNarrow() []string {
  153. return de.daysNarrow
  154. }
  155. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  156. func (de *de_AT) WeekdayShort(weekday time.Weekday) string {
  157. return de.daysShort[weekday]
  158. }
  159. // WeekdaysShort returns the locales short weekdays
  160. func (de *de_AT) WeekdaysShort() []string {
  161. return de.daysShort
  162. }
  163. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  164. func (de *de_AT) WeekdayWide(weekday time.Weekday) string {
  165. return de.daysWide[weekday]
  166. }
  167. // WeekdaysWide returns the locales wide weekdays
  168. func (de *de_AT) WeekdaysWide() []string {
  169. return de.daysWide
  170. }
  171. // Decimal returns the decimal point of number
  172. func (de *de_AT) Decimal() string {
  173. return de.decimal
  174. }
  175. // Group returns the group of number
  176. func (de *de_AT) Group() string {
  177. return de.group
  178. }
  179. // Group returns the minus sign of number
  180. func (de *de_AT) Minus() string {
  181. return de.minus
  182. }
  183. // FmtNumber returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
  184. func (de *de_AT) FmtNumber(num float64, v uint64) string {
  185. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  186. l := len(s) + 2 + 2*len(s[:len(s)-int(v)-1])/3
  187. count := 0
  188. inWhole := v == 0
  189. b := make([]byte, 0, l)
  190. for i := len(s) - 1; i >= 0; i-- {
  191. if s[i] == '.' {
  192. b = append(b, de.decimal[0])
  193. inWhole = true
  194. continue
  195. }
  196. if inWhole {
  197. if count == 3 {
  198. for j := len(de.group) - 1; j >= 0; j-- {
  199. b = append(b, de.group[j])
  200. }
  201. count = 1
  202. } else {
  203. count++
  204. }
  205. }
  206. b = append(b, s[i])
  207. }
  208. if num < 0 {
  209. b = append(b, de.minus[0])
  210. }
  211. // reverse
  212. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  213. b[i], b[j] = b[j], b[i]
  214. }
  215. return string(b)
  216. }
  217. // FmtPercent returns 'num' with digits/precision of 'v' for 'de_AT' and handles both Whole and Real numbers based on 'v'
  218. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  219. func (de *de_AT) FmtPercent(num float64, v uint64) string {
  220. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  221. l := len(s) + 5
  222. b := make([]byte, 0, l)
  223. for i := len(s) - 1; i >= 0; i-- {
  224. if s[i] == '.' {
  225. b = append(b, de.decimal[0])
  226. continue
  227. }
  228. b = append(b, s[i])
  229. }
  230. if num < 0 {
  231. b = append(b, de.minus[0])
  232. }
  233. // reverse
  234. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  235. b[i], b[j] = b[j], b[i]
  236. }
  237. b = append(b, de.percentSuffix...)
  238. b = append(b, de.percent...)
  239. return string(b)
  240. }
  241. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
  242. func (de *de_AT) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  243. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  244. symbol := de.currencies[currency]
  245. l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
  246. count := 0
  247. inWhole := v == 0
  248. b := make([]byte, 0, l)
  249. for i := len(s) - 1; i >= 0; i-- {
  250. if s[i] == '.' {
  251. b = append(b, de.decimal[0])
  252. inWhole = true
  253. continue
  254. }
  255. if inWhole {
  256. if count == 3 {
  257. for j := len(de.group) - 1; j >= 0; j-- {
  258. b = append(b, de.group[j])
  259. }
  260. count = 1
  261. } else {
  262. count++
  263. }
  264. }
  265. b = append(b, s[i])
  266. }
  267. for j := len(symbol) - 1; j >= 0; j-- {
  268. b = append(b, symbol[j])
  269. }
  270. for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
  271. b = append(b, de.currencyPositivePrefix[j])
  272. }
  273. if num < 0 {
  274. b = append(b, de.minus[0])
  275. }
  276. // reverse
  277. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  278. b[i], b[j] = b[j], b[i]
  279. }
  280. if int(v) < 2 {
  281. if v == 0 {
  282. b = append(b, de.decimal...)
  283. }
  284. for i := 0; i < 2-int(v); i++ {
  285. b = append(b, '0')
  286. }
  287. }
  288. return string(b)
  289. }
  290. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'de_AT'
  291. // in accounting notation.
  292. func (de *de_AT) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  293. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  294. symbol := de.currencies[currency]
  295. l := len(s) + len(symbol) + 4 + 2*len(s[:len(s)-int(v)-1])/3
  296. count := 0
  297. inWhole := v == 0
  298. b := make([]byte, 0, l)
  299. for i := len(s) - 1; i >= 0; i-- {
  300. if s[i] == '.' {
  301. b = append(b, de.decimal[0])
  302. inWhole = true
  303. continue
  304. }
  305. if inWhole {
  306. if count == 3 {
  307. for j := len(de.group) - 1; j >= 0; j-- {
  308. b = append(b, de.group[j])
  309. }
  310. count = 1
  311. } else {
  312. count++
  313. }
  314. }
  315. b = append(b, s[i])
  316. }
  317. if num < 0 {
  318. for j := len(symbol) - 1; j >= 0; j-- {
  319. b = append(b, symbol[j])
  320. }
  321. for j := len(de.currencyNegativePrefix) - 1; j >= 0; j-- {
  322. b = append(b, de.currencyNegativePrefix[j])
  323. }
  324. b = append(b, de.minus[0])
  325. } else {
  326. for j := len(symbol) - 1; j >= 0; j-- {
  327. b = append(b, symbol[j])
  328. }
  329. for j := len(de.currencyPositivePrefix) - 1; j >= 0; j-- {
  330. b = append(b, de.currencyPositivePrefix[j])
  331. }
  332. }
  333. // reverse
  334. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  335. b[i], b[j] = b[j], b[i]
  336. }
  337. if int(v) < 2 {
  338. if v == 0 {
  339. b = append(b, de.decimal...)
  340. }
  341. for i := 0; i < 2-int(v); i++ {
  342. b = append(b, '0')
  343. }
  344. }
  345. return string(b)
  346. }
  347. // FmtDateShort returns the short date representation of 't' for 'de_AT'
  348. func (de *de_AT) FmtDateShort(t time.Time) string {
  349. b := make([]byte, 0, 32)
  350. if t.Day() < 10 {
  351. b = append(b, '0')
  352. }
  353. b = strconv.AppendInt(b, int64(t.Day()), 10)
  354. b = append(b, []byte{0x2e}...)
  355. if t.Month() < 10 {
  356. b = append(b, '0')
  357. }
  358. b = strconv.AppendInt(b, int64(t.Month()), 10)
  359. b = append(b, []byte{0x2e}...)
  360. if t.Year() > 9 {
  361. b = append(b, strconv.Itoa(t.Year())[2:]...)
  362. } else {
  363. b = append(b, strconv.Itoa(t.Year())[1:]...)
  364. }
  365. return string(b)
  366. }
  367. // FmtDateMedium returns the medium date representation of 't' for 'de_AT'
  368. func (de *de_AT) FmtDateMedium(t time.Time) string {
  369. b := make([]byte, 0, 32)
  370. if t.Day() < 10 {
  371. b = append(b, '0')
  372. }
  373. b = strconv.AppendInt(b, int64(t.Day()), 10)
  374. b = append(b, []byte{0x2e}...)
  375. if t.Month() < 10 {
  376. b = append(b, '0')
  377. }
  378. b = strconv.AppendInt(b, int64(t.Month()), 10)
  379. b = append(b, []byte{0x2e}...)
  380. if t.Year() > 0 {
  381. b = strconv.AppendInt(b, int64(t.Year()), 10)
  382. } else {
  383. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  384. }
  385. return string(b)
  386. }
  387. // FmtDateLong returns the long date representation of 't' for 'de_AT'
  388. func (de *de_AT) FmtDateLong(t time.Time) string {
  389. b := make([]byte, 0, 32)
  390. b = strconv.AppendInt(b, int64(t.Day()), 10)
  391. b = append(b, []byte{0x2e, 0x20}...)
  392. b = append(b, de.monthsWide[t.Month()]...)
  393. b = append(b, []byte{0x20}...)
  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. return string(b)
  400. }
  401. // FmtDateFull returns the full date representation of 't' for 'de_AT'
  402. func (de *de_AT) FmtDateFull(t time.Time) string {
  403. b := make([]byte, 0, 32)
  404. b = append(b, de.daysWide[t.Weekday()]...)
  405. b = append(b, []byte{0x2c, 0x20}...)
  406. b = strconv.AppendInt(b, int64(t.Day()), 10)
  407. b = append(b, []byte{0x2e, 0x20}...)
  408. b = append(b, de.monthsWide[t.Month()]...)
  409. b = append(b, []byte{0x20}...)
  410. if t.Year() > 0 {
  411. b = strconv.AppendInt(b, int64(t.Year()), 10)
  412. } else {
  413. b = strconv.AppendInt(b, int64(-t.Year()), 10)
  414. }
  415. return string(b)
  416. }
  417. // FmtTimeShort returns the short time representation of 't' for 'de_AT'
  418. func (de *de_AT) FmtTimeShort(t time.Time) string {
  419. b := make([]byte, 0, 32)
  420. if t.Hour() < 10 {
  421. b = append(b, '0')
  422. }
  423. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  424. b = append(b, de.timeSeparator...)
  425. if t.Minute() < 10 {
  426. b = append(b, '0')
  427. }
  428. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  429. return string(b)
  430. }
  431. // FmtTimeMedium returns the medium time representation of 't' for 'de_AT'
  432. func (de *de_AT) FmtTimeMedium(t time.Time) string {
  433. b := make([]byte, 0, 32)
  434. if t.Hour() < 10 {
  435. b = append(b, '0')
  436. }
  437. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  438. b = append(b, de.timeSeparator...)
  439. if t.Minute() < 10 {
  440. b = append(b, '0')
  441. }
  442. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  443. b = append(b, de.timeSeparator...)
  444. if t.Second() < 10 {
  445. b = append(b, '0')
  446. }
  447. b = strconv.AppendInt(b, int64(t.Second()), 10)
  448. return string(b)
  449. }
  450. // FmtTimeLong returns the long time representation of 't' for 'de_AT'
  451. func (de *de_AT) FmtTimeLong(t time.Time) string {
  452. b := make([]byte, 0, 32)
  453. if t.Hour() < 10 {
  454. b = append(b, '0')
  455. }
  456. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  457. b = append(b, de.timeSeparator...)
  458. if t.Minute() < 10 {
  459. b = append(b, '0')
  460. }
  461. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  462. b = append(b, de.timeSeparator...)
  463. if t.Second() < 10 {
  464. b = append(b, '0')
  465. }
  466. b = strconv.AppendInt(b, int64(t.Second()), 10)
  467. b = append(b, []byte{0x20}...)
  468. tz, _ := t.Zone()
  469. b = append(b, tz...)
  470. return string(b)
  471. }
  472. // FmtTimeFull returns the full time representation of 't' for 'de_AT'
  473. func (de *de_AT) FmtTimeFull(t time.Time) string {
  474. b := make([]byte, 0, 32)
  475. if t.Hour() < 10 {
  476. b = append(b, '0')
  477. }
  478. b = strconv.AppendInt(b, int64(t.Hour()), 10)
  479. b = append(b, de.timeSeparator...)
  480. if t.Minute() < 10 {
  481. b = append(b, '0')
  482. }
  483. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  484. b = append(b, de.timeSeparator...)
  485. if t.Second() < 10 {
  486. b = append(b, '0')
  487. }
  488. b = strconv.AppendInt(b, int64(t.Second()), 10)
  489. b = append(b, []byte{0x20}...)
  490. tz, _ := t.Zone()
  491. if btz, ok := de.timezones[tz]; ok {
  492. b = append(b, btz...)
  493. } else {
  494. b = append(b, tz...)
  495. }
  496. return string(b)
  497. }