kab.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527
  1. package kab
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type kab 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. perMille string
  19. timeSeparator string
  20. inifinity string
  21. currencies []string // idx = enum of currency code
  22. monthsAbbreviated []string
  23. monthsNarrow []string
  24. monthsWide []string
  25. daysAbbreviated []string
  26. daysNarrow []string
  27. daysShort []string
  28. daysWide []string
  29. periodsAbbreviated []string
  30. periodsNarrow []string
  31. periodsShort []string
  32. periodsWide []string
  33. erasAbbreviated []string
  34. erasNarrow []string
  35. erasWide []string
  36. timezones map[string]string
  37. }
  38. // New returns a new instance of translator for the 'kab' locale
  39. func New() locales.Translator {
  40. return &kab{
  41. locale: "kab",
  42. pluralsCardinal: []locales.PluralRule{2, 6},
  43. pluralsOrdinal: nil,
  44. pluralsRange: nil,
  45. decimal: ",",
  46. group: " ",
  47. timeSeparator: ":",
  48. 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 ", "DA", "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 "},
  49. monthsAbbreviated: []string{"", "Yen", "Fur", "Meɣ", "Yeb", "May", "Yun", "Yul", "Ɣuc", "Cte", "Tub", "Nun", "Duǧ"},
  50. monthsNarrow: []string{"", "Y", "F", "M", "Y", "M", "Y", "Y", "Ɣ", "C", "T", "N", "D"},
  51. monthsWide: []string{"", "Yennayer", "Fuṛar", "Meɣres", "Yebrir", "Mayyu", "Yunyu", "Yulyu", "Ɣuct", "Ctembeṛ", "Tubeṛ", "Nunembeṛ", "Duǧembeṛ"},
  52. daysAbbreviated: []string{"Yan", "San", "Kraḍ", "Kuẓ", "Sam", "Sḍis", "Say"},
  53. daysNarrow: []string{"Y", "S", "K", "K", "S", "S", "S"},
  54. daysWide: []string{"Yanass", "Sanass", "Kraḍass", "Kuẓass", "Samass", "Sḍisass", "Sayass"},
  55. periodsAbbreviated: []string{"n tufat", "n tmeddit"},
  56. periodsWide: []string{"n tufat", "n tmeddit"},
  57. erasAbbreviated: []string{"snd. T.Ɛ", "sld. T.Ɛ"},
  58. erasNarrow: []string{"", ""},
  59. erasWide: []string{"send talalit n Ɛisa", "seld talalit n Ɛisa"},
  60. timezones: map[string]string{"COT": "COT", "AST": "AST", "OEZ": "OEZ", "HAT": "HAT", "TMST": "TMST", "LHST": "LHST", "UYT": "UYT", "MESZ": "MESZ", "CHAST": "CHAST", "COST": "COST", "SAST": "SAST", "GMT": "GMT", "NZST": "NZST", "PST": "PST", "BOT": "BOT", "MDT": "MDT", "ACWST": "ACWST", "CAT": "CAT", "EST": "EST", "AWST": "AWST", "AWDT": "AWDT", "SGT": "SGT", "IST": "IST", "ACST": "ACST", "ACDT": "ACDT", "OESZ": "OESZ", "CST": "CST", "MEZ": "MEZ", "ECT": "ECT", "WAST": "WAST", "GFT": "GFT", "GYT": "GYT", "MST": "MST", "ACWDT": "ACWDT", "AEDT": "AEDT", "∅∅∅": "∅∅∅", "NZDT": "NZDT", "HKST": "HKST", "VET": "VET", "TMT": "TMT", "WIT": "WIT", "MYT": "MYT", "AKST": "AKST", "WEZ": "WEZ", "AEST": "AEST", "EDT": "EDT", "HADT": "HADT", "CLT": "CLT", "ADT": "ADT", "WAT": "WAT", "HNT": "HNT", "EAT": "EAT", "JDT": "JDT", "CHADT": "CHADT", "WESZ": "WESZ", "BT": "BT", "WITA": "WITA", "ChST": "ChST", "AKDT": "AKDT", "LHDT": "LHDT", "SRT": "SRT", "UYST": "UYST", "HAST": "HAST", "WART": "WART", "HKT": "HKT", "ARST": "ARST", "CLST": "CLST", "WIB": "WIB", "ART": "ART", "WARST": "WARST", "JST": "JST", "PDT": "PDT", "CDT": "CDT"},
  61. }
  62. }
  63. // Locale returns the current translators string locale
  64. func (kab *kab) Locale() string {
  65. return kab.locale
  66. }
  67. // PluralsCardinal returns the list of cardinal plural rules associated with 'kab'
  68. func (kab *kab) PluralsCardinal() []locales.PluralRule {
  69. return kab.pluralsCardinal
  70. }
  71. // PluralsOrdinal returns the list of ordinal plural rules associated with 'kab'
  72. func (kab *kab) PluralsOrdinal() []locales.PluralRule {
  73. return kab.pluralsOrdinal
  74. }
  75. // PluralsRange returns the list of range plural rules associated with 'kab'
  76. func (kab *kab) PluralsRange() []locales.PluralRule {
  77. return kab.pluralsRange
  78. }
  79. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'kab'
  80. func (kab *kab) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  81. n := math.Abs(num)
  82. i := int64(n)
  83. if i == 0 || i == 1 {
  84. return locales.PluralRuleOne
  85. }
  86. return locales.PluralRuleOther
  87. }
  88. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'kab'
  89. func (kab *kab) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  90. return locales.PluralRuleUnknown
  91. }
  92. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'kab'
  93. func (kab *kab) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  94. return locales.PluralRuleUnknown
  95. }
  96. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  97. func (kab *kab) MonthAbbreviated(month time.Month) string {
  98. return kab.monthsAbbreviated[month]
  99. }
  100. // MonthsAbbreviated returns the locales abbreviated months
  101. func (kab *kab) MonthsAbbreviated() []string {
  102. return kab.monthsAbbreviated[1:]
  103. }
  104. // MonthNarrow returns the locales narrow month given the 'month' provided
  105. func (kab *kab) MonthNarrow(month time.Month) string {
  106. return kab.monthsNarrow[month]
  107. }
  108. // MonthsNarrow returns the locales narrow months
  109. func (kab *kab) MonthsNarrow() []string {
  110. return kab.monthsNarrow[1:]
  111. }
  112. // MonthWide returns the locales wide month given the 'month' provided
  113. func (kab *kab) MonthWide(month time.Month) string {
  114. return kab.monthsWide[month]
  115. }
  116. // MonthsWide returns the locales wide months
  117. func (kab *kab) MonthsWide() []string {
  118. return kab.monthsWide[1:]
  119. }
  120. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  121. func (kab *kab) WeekdayAbbreviated(weekday time.Weekday) string {
  122. return kab.daysAbbreviated[weekday]
  123. }
  124. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  125. func (kab *kab) WeekdaysAbbreviated() []string {
  126. return kab.daysAbbreviated
  127. }
  128. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  129. func (kab *kab) WeekdayNarrow(weekday time.Weekday) string {
  130. return kab.daysNarrow[weekday]
  131. }
  132. // WeekdaysNarrow returns the locales narrow weekdays
  133. func (kab *kab) WeekdaysNarrow() []string {
  134. return kab.daysNarrow
  135. }
  136. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  137. func (kab *kab) WeekdayShort(weekday time.Weekday) string {
  138. return kab.daysShort[weekday]
  139. }
  140. // WeekdaysShort returns the locales short weekdays
  141. func (kab *kab) WeekdaysShort() []string {
  142. return kab.daysShort
  143. }
  144. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  145. func (kab *kab) WeekdayWide(weekday time.Weekday) string {
  146. return kab.daysWide[weekday]
  147. }
  148. // WeekdaysWide returns the locales wide weekdays
  149. func (kab *kab) WeekdaysWide() []string {
  150. return kab.daysWide
  151. }
  152. // FmtNumber returns 'num' with digits/precision of 'v' for 'kab' and handles both Whole and Real numbers based on 'v'
  153. func (kab *kab) FmtNumber(num float64, v uint64) string {
  154. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  155. }
  156. // FmtPercent returns 'num' with digits/precision of 'v' for 'kab' and handles both Whole and Real numbers based on 'v'
  157. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  158. func (kab *kab) FmtPercent(num float64, v uint64) string {
  159. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  160. }
  161. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'kab'
  162. func (kab *kab) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  163. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  164. symbol := kab.currencies[currency]
  165. l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
  166. count := 0
  167. inWhole := v == 0
  168. b := make([]byte, 0, l)
  169. for i := len(s) - 1; i >= 0; i-- {
  170. if s[i] == '.' {
  171. b = append(b, kab.decimal[0])
  172. inWhole = true
  173. continue
  174. }
  175. if inWhole {
  176. if count == 3 {
  177. for j := len(kab.group) - 1; j >= 0; j-- {
  178. b = append(b, kab.group[j])
  179. }
  180. count = 1
  181. } else {
  182. count++
  183. }
  184. }
  185. b = append(b, s[i])
  186. }
  187. if num < 0 {
  188. b = append(b, kab.minus[0])
  189. }
  190. // reverse
  191. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  192. b[i], b[j] = b[j], b[i]
  193. }
  194. if int(v) < 2 {
  195. if v == 0 {
  196. b = append(b, kab.decimal...)
  197. }
  198. for i := 0; i < 2-int(v); i++ {
  199. b = append(b, '0')
  200. }
  201. }
  202. b = append(b, symbol...)
  203. return string(b)
  204. }
  205. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'kab'
  206. // in accounting notation.
  207. func (kab *kab) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  208. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  209. symbol := kab.currencies[currency]
  210. l := len(s) + len(symbol) + 1 + 2*len(s[:len(s)-int(v)-1])/3
  211. count := 0
  212. inWhole := v == 0
  213. b := make([]byte, 0, l)
  214. for i := len(s) - 1; i >= 0; i-- {
  215. if s[i] == '.' {
  216. b = append(b, kab.decimal[0])
  217. inWhole = true
  218. continue
  219. }
  220. if inWhole {
  221. if count == 3 {
  222. for j := len(kab.group) - 1; j >= 0; j-- {
  223. b = append(b, kab.group[j])
  224. }
  225. count = 1
  226. } else {
  227. count++
  228. }
  229. }
  230. b = append(b, s[i])
  231. }
  232. if num < 0 {
  233. b = append(b, kab.minus[0])
  234. }
  235. // reverse
  236. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  237. b[i], b[j] = b[j], b[i]
  238. }
  239. if int(v) < 2 {
  240. if v == 0 {
  241. b = append(b, kab.decimal...)
  242. }
  243. for i := 0; i < 2-int(v); i++ {
  244. b = append(b, '0')
  245. }
  246. }
  247. if num < 0 {
  248. b = append(b, symbol...)
  249. } else {
  250. b = append(b, symbol...)
  251. }
  252. return string(b)
  253. }
  254. // FmtDateShort returns the short date representation of 't' for 'kab'
  255. func (kab *kab) FmtDateShort(t time.Time) string {
  256. b := make([]byte, 0, 32)
  257. b = strconv.AppendInt(b, int64(t.Day()), 10)
  258. b = append(b, []byte{0x2f}...)
  259. b = strconv.AppendInt(b, int64(t.Month()), 10)
  260. b = append(b, []byte{0x2f}...)
  261. b = strconv.AppendInt(b, int64(t.Year()), 10)
  262. return string(b)
  263. }
  264. // FmtDateMedium returns the medium date representation of 't' for 'kab'
  265. func (kab *kab) FmtDateMedium(t time.Time) string {
  266. b := make([]byte, 0, 32)
  267. b = strconv.AppendInt(b, int64(t.Day()), 10)
  268. b = append(b, []byte{0x20}...)
  269. b = append(b, kab.monthsAbbreviated[t.Month()]...)
  270. b = append(b, []byte{0x2c, 0x20}...)
  271. b = strconv.AppendInt(b, int64(t.Year()), 10)
  272. return string(b)
  273. }
  274. // FmtDateLong returns the long date representation of 't' for 'kab'
  275. func (kab *kab) FmtDateLong(t time.Time) string {
  276. b := make([]byte, 0, 32)
  277. b = strconv.AppendInt(b, int64(t.Day()), 10)
  278. b = append(b, []byte{0x20}...)
  279. b = append(b, kab.monthsWide[t.Month()]...)
  280. b = append(b, []byte{0x20}...)
  281. b = strconv.AppendInt(b, int64(t.Year()), 10)
  282. return string(b)
  283. }
  284. // FmtDateFull returns the full date representation of 't' for 'kab'
  285. func (kab *kab) FmtDateFull(t time.Time) string {
  286. b := make([]byte, 0, 32)
  287. b = append(b, kab.daysWide[t.Weekday()]...)
  288. b = append(b, []byte{0x20}...)
  289. b = strconv.AppendInt(b, int64(t.Day()), 10)
  290. b = append(b, []byte{0x20}...)
  291. b = append(b, kab.monthsWide[t.Month()]...)
  292. b = append(b, []byte{0x20}...)
  293. b = strconv.AppendInt(b, int64(t.Year()), 10)
  294. return string(b)
  295. }
  296. // FmtTimeShort returns the short time representation of 't' for 'kab'
  297. func (kab *kab) FmtTimeShort(t time.Time) string {
  298. b := make([]byte, 0, 32)
  299. h := t.Hour()
  300. if h > 12 {
  301. h -= 12
  302. }
  303. b = strconv.AppendInt(b, int64(h), 10)
  304. b = append(b, kab.timeSeparator...)
  305. if t.Minute() < 10 {
  306. b = append(b, '0')
  307. }
  308. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  309. b = append(b, []byte{0x20}...)
  310. if t.Hour() < 12 {
  311. b = append(b, kab.periodsAbbreviated[0]...)
  312. } else {
  313. b = append(b, kab.periodsAbbreviated[1]...)
  314. }
  315. return string(b)
  316. }
  317. // FmtTimeMedium returns the medium time representation of 't' for 'kab'
  318. func (kab *kab) FmtTimeMedium(t time.Time) string {
  319. b := make([]byte, 0, 32)
  320. h := t.Hour()
  321. if h > 12 {
  322. h -= 12
  323. }
  324. b = strconv.AppendInt(b, int64(h), 10)
  325. b = append(b, kab.timeSeparator...)
  326. if t.Minute() < 10 {
  327. b = append(b, '0')
  328. }
  329. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  330. b = append(b, kab.timeSeparator...)
  331. if t.Second() < 10 {
  332. b = append(b, '0')
  333. }
  334. b = strconv.AppendInt(b, int64(t.Second()), 10)
  335. b = append(b, []byte{0x20}...)
  336. if t.Hour() < 12 {
  337. b = append(b, kab.periodsAbbreviated[0]...)
  338. } else {
  339. b = append(b, kab.periodsAbbreviated[1]...)
  340. }
  341. return string(b)
  342. }
  343. // FmtTimeLong returns the long time representation of 't' for 'kab'
  344. func (kab *kab) FmtTimeLong(t time.Time) string {
  345. b := make([]byte, 0, 32)
  346. h := t.Hour()
  347. if h > 12 {
  348. h -= 12
  349. }
  350. b = strconv.AppendInt(b, int64(h), 10)
  351. b = append(b, kab.timeSeparator...)
  352. if t.Minute() < 10 {
  353. b = append(b, '0')
  354. }
  355. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  356. b = append(b, kab.timeSeparator...)
  357. if t.Second() < 10 {
  358. b = append(b, '0')
  359. }
  360. b = strconv.AppendInt(b, int64(t.Second()), 10)
  361. b = append(b, []byte{0x20}...)
  362. if t.Hour() < 12 {
  363. b = append(b, kab.periodsAbbreviated[0]...)
  364. } else {
  365. b = append(b, kab.periodsAbbreviated[1]...)
  366. }
  367. b = append(b, []byte{0x20}...)
  368. tz, _ := t.Zone()
  369. b = append(b, tz...)
  370. return string(b)
  371. }
  372. // FmtTimeFull returns the full time representation of 't' for 'kab'
  373. func (kab *kab) FmtTimeFull(t time.Time) string {
  374. b := make([]byte, 0, 32)
  375. h := t.Hour()
  376. if h > 12 {
  377. h -= 12
  378. }
  379. b = strconv.AppendInt(b, int64(h), 10)
  380. b = append(b, kab.timeSeparator...)
  381. if t.Minute() < 10 {
  382. b = append(b, '0')
  383. }
  384. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  385. b = append(b, kab.timeSeparator...)
  386. if t.Second() < 10 {
  387. b = append(b, '0')
  388. }
  389. b = strconv.AppendInt(b, int64(t.Second()), 10)
  390. b = append(b, []byte{0x20}...)
  391. if t.Hour() < 12 {
  392. b = append(b, kab.periodsAbbreviated[0]...)
  393. } else {
  394. b = append(b, kab.periodsAbbreviated[1]...)
  395. }
  396. b = append(b, []byte{0x20}...)
  397. tz, _ := t.Zone()
  398. if btz, ok := kab.timezones[tz]; ok {
  399. b = append(b, btz...)
  400. } else {
  401. b = append(b, tz...)
  402. }
  403. return string(b)
  404. }