lkt.go 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506
  1. package lkt
  2. import (
  3. "math"
  4. "strconv"
  5. "time"
  6. "github.com/go-playground/locales"
  7. "github.com/go-playground/locales/currency"
  8. )
  9. type lkt 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. currencyPositivePrefix string
  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 'lkt' locale
  43. func New() locales.Translator {
  44. return &lkt{
  45. locale: "lkt",
  46. pluralsCardinal: []locales.PluralRule{6},
  47. pluralsOrdinal: nil,
  48. pluralsRange: nil,
  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 ", "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 ", "$", "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. currencyPositivePrefix: " ",
  58. currencyPositiveSuffix: "K",
  59. currencyNegativePrefix: " ",
  60. currencyNegativeSuffix: "K",
  61. monthsWide: []string{"", "Wiótheȟika Wí", "Thiyóȟeyuŋka Wí", "Ištáwičhayazaŋ Wí", "Pȟežítȟo Wí", "Čhaŋwápetȟo Wí", "Wípazukȟa-wašté Wí", "Čhaŋpȟásapa Wí", "Wasútȟuŋ Wí", "Čhaŋwápeǧi Wí", "Čhaŋwápe-kasná Wí", "Waníyetu Wí", "Tȟahékapšuŋ Wí"},
  62. daysNarrow: []string{"A", "W", "N", "Y", "T", "Z", "O"},
  63. daysWide: []string{"Aŋpétuwakȟaŋ", "Aŋpétuwaŋži", "Aŋpétunuŋpa", "Aŋpétuyamni", "Aŋpétutopa", "Aŋpétuzaptaŋ", "Owáŋgyužažapi"},
  64. timezones: map[string]string{"SRT": "SRT", "VET": "VET", "AWDT": "AWDT", "ACDT": "ACDT", "UYST": "UYST", "CST": "CST", "CHADT": "CHADT", "OEZ": "OEZ", "WIB": "WIB", "AKDT": "AKDT", "ACWDT": "ACWDT", "CLT": "CLT", "EDT": "EDT", "WARST": "WARST", "ARST": "ARST", "PDT": "PDT", "JST": "JST", "UYT": "UYT", "AEST": "AEST", "ChST": "ChST", "CAT": "CAT", "COST": "COST", "GMT": "GMT", "MDT": "MDT", "PST": "PST", "ACWST": "ACWST", "CLST": "CLST", "EST": "EST", "JDT": "JDT", "CHAST": "CHAST", "ART": "ART", "LHDT": "LHDT", "EAT": "EAT", "HKST": "HKST", "WART": "WART", "MST": "MST", "NZST": "NZST", "BOT": "BOT", "CDT": "CDT", "AST": "AST", "LHST": "LHST", "GYT": "GYT", "AEDT": "AEDT", "HKT": "HKT", "OESZ": "OESZ", "WITA": "WITA", "TMT": "TMT", "AWST": "AWST", "WEZ": "WEZ", "ADT": "ADT", "SGT": "SGT", "SAST": "SAST", "TMST": "TMST", "MEZ": "MEZ", "NZDT": "NZDT", "HAST": "HAST", "WAT": "WAT", "ACST": "ACST", "AKST": "AKST", "MESZ": "MESZ", "WESZ": "WESZ", "ECT": "ECT", "GFT": "GFT", "IST": "IST", "BT": "BT", "∅∅∅": "∅∅∅", "WAST": "WAST", "HNT": "HNT", "HAT": "HAT", "WIT": "WIT", "COT": "COT", "MYT": "MYT", "HADT": "HADT"},
  65. }
  66. }
  67. // Locale returns the current translators string locale
  68. func (lkt *lkt) Locale() string {
  69. return lkt.locale
  70. }
  71. // PluralsCardinal returns the list of cardinal plural rules associated with 'lkt'
  72. func (lkt *lkt) PluralsCardinal() []locales.PluralRule {
  73. return lkt.pluralsCardinal
  74. }
  75. // PluralsOrdinal returns the list of ordinal plural rules associated with 'lkt'
  76. func (lkt *lkt) PluralsOrdinal() []locales.PluralRule {
  77. return lkt.pluralsOrdinal
  78. }
  79. // PluralsRange returns the list of range plural rules associated with 'lkt'
  80. func (lkt *lkt) PluralsRange() []locales.PluralRule {
  81. return lkt.pluralsRange
  82. }
  83. // CardinalPluralRule returns the cardinal PluralRule given 'num' and digits/precision of 'v' for 'lkt'
  84. func (lkt *lkt) CardinalPluralRule(num float64, v uint64) locales.PluralRule {
  85. return locales.PluralRuleOther
  86. }
  87. // OrdinalPluralRule returns the ordinal PluralRule given 'num' and digits/precision of 'v' for 'lkt'
  88. func (lkt *lkt) OrdinalPluralRule(num float64, v uint64) locales.PluralRule {
  89. return locales.PluralRuleUnknown
  90. }
  91. // RangePluralRule returns the ordinal PluralRule given 'num1', 'num2' and digits/precision of 'v1' and 'v2' for 'lkt'
  92. func (lkt *lkt) RangePluralRule(num1 float64, v1 uint64, num2 float64, v2 uint64) locales.PluralRule {
  93. return locales.PluralRuleUnknown
  94. }
  95. // MonthAbbreviated returns the locales abbreviated month given the 'month' provided
  96. func (lkt *lkt) MonthAbbreviated(month time.Month) string {
  97. return lkt.monthsAbbreviated[month]
  98. }
  99. // MonthsAbbreviated returns the locales abbreviated months
  100. func (lkt *lkt) MonthsAbbreviated() []string {
  101. return lkt.monthsAbbreviated[1:]
  102. }
  103. // MonthNarrow returns the locales narrow month given the 'month' provided
  104. func (lkt *lkt) MonthNarrow(month time.Month) string {
  105. return lkt.monthsNarrow[month]
  106. }
  107. // MonthsNarrow returns the locales narrow months
  108. func (lkt *lkt) MonthsNarrow() []string {
  109. return lkt.monthsNarrow[1:]
  110. }
  111. // MonthWide returns the locales wide month given the 'month' provided
  112. func (lkt *lkt) MonthWide(month time.Month) string {
  113. return lkt.monthsWide[month]
  114. }
  115. // MonthsWide returns the locales wide months
  116. func (lkt *lkt) MonthsWide() []string {
  117. return lkt.monthsWide[1:]
  118. }
  119. // WeekdayAbbreviated returns the locales abbreviated weekday given the 'weekday' provided
  120. func (lkt *lkt) WeekdayAbbreviated(weekday time.Weekday) string {
  121. return lkt.daysAbbreviated[weekday]
  122. }
  123. // WeekdaysAbbreviated returns the locales abbreviated weekdays
  124. func (lkt *lkt) WeekdaysAbbreviated() []string {
  125. return lkt.daysAbbreviated
  126. }
  127. // WeekdayNarrow returns the locales narrow weekday given the 'weekday' provided
  128. func (lkt *lkt) WeekdayNarrow(weekday time.Weekday) string {
  129. return lkt.daysNarrow[weekday]
  130. }
  131. // WeekdaysNarrow returns the locales narrow weekdays
  132. func (lkt *lkt) WeekdaysNarrow() []string {
  133. return lkt.daysNarrow
  134. }
  135. // WeekdayShort returns the locales short weekday given the 'weekday' provided
  136. func (lkt *lkt) WeekdayShort(weekday time.Weekday) string {
  137. return lkt.daysShort[weekday]
  138. }
  139. // WeekdaysShort returns the locales short weekdays
  140. func (lkt *lkt) WeekdaysShort() []string {
  141. return lkt.daysShort
  142. }
  143. // WeekdayWide returns the locales wide weekday given the 'weekday' provided
  144. func (lkt *lkt) WeekdayWide(weekday time.Weekday) string {
  145. return lkt.daysWide[weekday]
  146. }
  147. // WeekdaysWide returns the locales wide weekdays
  148. func (lkt *lkt) WeekdaysWide() []string {
  149. return lkt.daysWide
  150. }
  151. // FmtNumber returns 'num' with digits/precision of 'v' for 'lkt' and handles both Whole and Real numbers based on 'v'
  152. func (lkt *lkt) FmtNumber(num float64, v uint64) string {
  153. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  154. }
  155. // FmtPercent returns 'num' with digits/precision of 'v' for 'lkt' and handles both Whole and Real numbers based on 'v'
  156. // NOTE: 'num' passed into FmtPercent is assumed to be in percent already
  157. func (lkt *lkt) FmtPercent(num float64, v uint64) string {
  158. return strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  159. }
  160. // FmtCurrency returns the currency representation of 'num' with digits/precision of 'v' for 'lkt'
  161. func (lkt *lkt) FmtCurrency(num float64, v uint64, currency currency.Type) string {
  162. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  163. symbol := lkt.currencies[currency]
  164. l := len(s) + len(symbol) + 5
  165. b := make([]byte, 0, l)
  166. for i := len(s) - 1; i >= 0; i-- {
  167. if s[i] == '.' {
  168. b = append(b, lkt.decimal[0])
  169. continue
  170. }
  171. b = append(b, s[i])
  172. }
  173. for j := len(symbol) - 1; j >= 0; j-- {
  174. b = append(b, symbol[j])
  175. }
  176. for j := len(lkt.currencyPositivePrefix) - 1; j >= 0; j-- {
  177. b = append(b, lkt.currencyPositivePrefix[j])
  178. }
  179. if num < 0 {
  180. b = append(b, lkt.minus[0])
  181. }
  182. // reverse
  183. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  184. b[i], b[j] = b[j], b[i]
  185. }
  186. b = append(b, lkt.currencyPositiveSuffix...)
  187. return string(b)
  188. }
  189. // FmtAccounting returns the currency representation of 'num' with digits/precision of 'v' for 'lkt'
  190. // in accounting notation.
  191. func (lkt *lkt) FmtAccounting(num float64, v uint64, currency currency.Type) string {
  192. s := strconv.FormatFloat(math.Abs(num), 'f', int(v), 64)
  193. symbol := lkt.currencies[currency]
  194. l := len(s) + len(symbol) + 5
  195. b := make([]byte, 0, l)
  196. for i := len(s) - 1; i >= 0; i-- {
  197. if s[i] == '.' {
  198. b = append(b, lkt.decimal[0])
  199. continue
  200. }
  201. b = append(b, s[i])
  202. }
  203. if num < 0 {
  204. for j := len(symbol) - 1; j >= 0; j-- {
  205. b = append(b, symbol[j])
  206. }
  207. for j := len(lkt.currencyNegativePrefix) - 1; j >= 0; j-- {
  208. b = append(b, lkt.currencyNegativePrefix[j])
  209. }
  210. b = append(b, lkt.minus[0])
  211. } else {
  212. for j := len(symbol) - 1; j >= 0; j-- {
  213. b = append(b, symbol[j])
  214. }
  215. for j := len(lkt.currencyPositivePrefix) - 1; j >= 0; j-- {
  216. b = append(b, lkt.currencyPositivePrefix[j])
  217. }
  218. }
  219. // reverse
  220. for i, j := 0, len(b)-1; i < j; i, j = i+1, j-1 {
  221. b[i], b[j] = b[j], b[i]
  222. }
  223. if num < 0 {
  224. b = append(b, lkt.currencyNegativeSuffix...)
  225. } else {
  226. b = append(b, lkt.currencyPositiveSuffix...)
  227. }
  228. return string(b)
  229. }
  230. // FmtDateShort returns the short date representation of 't' for 'lkt'
  231. func (lkt *lkt) FmtDateShort(t time.Time) string {
  232. b := make([]byte, 0, 32)
  233. b = strconv.AppendInt(b, int64(t.Month()), 10)
  234. b = append(b, []byte{0x2f}...)
  235. b = strconv.AppendInt(b, int64(t.Day()), 10)
  236. b = append(b, []byte{0x2f}...)
  237. if t.Year() > 9 {
  238. b = append(b, strconv.Itoa(t.Year())[2:]...)
  239. } else {
  240. b = append(b, strconv.Itoa(t.Year())[1:]...)
  241. }
  242. return string(b)
  243. }
  244. // FmtDateMedium returns the medium date representation of 't' for 'lkt'
  245. func (lkt *lkt) FmtDateMedium(t time.Time) string {
  246. b := make([]byte, 0, 32)
  247. b = append(b, lkt.monthsAbbreviated[t.Month()]...)
  248. b = append(b, []byte{0x20}...)
  249. b = strconv.AppendInt(b, int64(t.Day()), 10)
  250. b = append(b, []byte{0x2c, 0x20}...)
  251. b = strconv.AppendInt(b, int64(t.Year()), 10)
  252. return string(b)
  253. }
  254. // FmtDateLong returns the long date representation of 't' for 'lkt'
  255. func (lkt *lkt) FmtDateLong(t time.Time) string {
  256. b := make([]byte, 0, 32)
  257. b = append(b, lkt.monthsWide[t.Month()]...)
  258. b = append(b, []byte{0x20}...)
  259. b = strconv.AppendInt(b, int64(t.Day()), 10)
  260. b = append(b, []byte{0x2c, 0x20}...)
  261. b = strconv.AppendInt(b, int64(t.Year()), 10)
  262. return string(b)
  263. }
  264. // FmtDateFull returns the full date representation of 't' for 'lkt'
  265. func (lkt *lkt) FmtDateFull(t time.Time) string {
  266. b := make([]byte, 0, 32)
  267. b = append(b, lkt.daysWide[t.Weekday()]...)
  268. b = append(b, []byte{0x2c, 0x20}...)
  269. b = append(b, lkt.monthsWide[t.Month()]...)
  270. b = append(b, []byte{0x20}...)
  271. b = strconv.AppendInt(b, int64(t.Day()), 10)
  272. b = append(b, []byte{0x2c, 0x20}...)
  273. b = strconv.AppendInt(b, int64(t.Year()), 10)
  274. return string(b)
  275. }
  276. // FmtTimeShort returns the short time representation of 't' for 'lkt'
  277. func (lkt *lkt) FmtTimeShort(t time.Time) string {
  278. b := make([]byte, 0, 32)
  279. h := t.Hour()
  280. if h > 12 {
  281. h -= 12
  282. }
  283. b = strconv.AppendInt(b, int64(h), 10)
  284. b = append(b, lkt.timeSeparator...)
  285. if t.Minute() < 10 {
  286. b = append(b, '0')
  287. }
  288. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  289. b = append(b, []byte{0x20}...)
  290. if t.Hour() < 12 {
  291. b = append(b, lkt.periodsAbbreviated[0]...)
  292. } else {
  293. b = append(b, lkt.periodsAbbreviated[1]...)
  294. }
  295. return string(b)
  296. }
  297. // FmtTimeMedium returns the medium time representation of 't' for 'lkt'
  298. func (lkt *lkt) FmtTimeMedium(t time.Time) string {
  299. b := make([]byte, 0, 32)
  300. h := t.Hour()
  301. if h > 12 {
  302. h -= 12
  303. }
  304. b = strconv.AppendInt(b, int64(h), 10)
  305. b = append(b, lkt.timeSeparator...)
  306. if t.Minute() < 10 {
  307. b = append(b, '0')
  308. }
  309. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  310. b = append(b, lkt.timeSeparator...)
  311. if t.Second() < 10 {
  312. b = append(b, '0')
  313. }
  314. b = strconv.AppendInt(b, int64(t.Second()), 10)
  315. b = append(b, []byte{0x20}...)
  316. if t.Hour() < 12 {
  317. b = append(b, lkt.periodsAbbreviated[0]...)
  318. } else {
  319. b = append(b, lkt.periodsAbbreviated[1]...)
  320. }
  321. return string(b)
  322. }
  323. // FmtTimeLong returns the long time representation of 't' for 'lkt'
  324. func (lkt *lkt) FmtTimeLong(t time.Time) string {
  325. b := make([]byte, 0, 32)
  326. h := t.Hour()
  327. if h > 12 {
  328. h -= 12
  329. }
  330. b = strconv.AppendInt(b, int64(h), 10)
  331. b = append(b, lkt.timeSeparator...)
  332. if t.Minute() < 10 {
  333. b = append(b, '0')
  334. }
  335. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  336. b = append(b, lkt.timeSeparator...)
  337. if t.Second() < 10 {
  338. b = append(b, '0')
  339. }
  340. b = strconv.AppendInt(b, int64(t.Second()), 10)
  341. b = append(b, []byte{0x20}...)
  342. if t.Hour() < 12 {
  343. b = append(b, lkt.periodsAbbreviated[0]...)
  344. } else {
  345. b = append(b, lkt.periodsAbbreviated[1]...)
  346. }
  347. b = append(b, []byte{0x20}...)
  348. tz, _ := t.Zone()
  349. b = append(b, tz...)
  350. return string(b)
  351. }
  352. // FmtTimeFull returns the full time representation of 't' for 'lkt'
  353. func (lkt *lkt) FmtTimeFull(t time.Time) string {
  354. b := make([]byte, 0, 32)
  355. h := t.Hour()
  356. if h > 12 {
  357. h -= 12
  358. }
  359. b = strconv.AppendInt(b, int64(h), 10)
  360. b = append(b, lkt.timeSeparator...)
  361. if t.Minute() < 10 {
  362. b = append(b, '0')
  363. }
  364. b = strconv.AppendInt(b, int64(t.Minute()), 10)
  365. b = append(b, lkt.timeSeparator...)
  366. if t.Second() < 10 {
  367. b = append(b, '0')
  368. }
  369. b = strconv.AppendInt(b, int64(t.Second()), 10)
  370. b = append(b, []byte{0x20}...)
  371. if t.Hour() < 12 {
  372. b = append(b, lkt.periodsAbbreviated[0]...)
  373. } else {
  374. b = append(b, lkt.periodsAbbreviated[1]...)
  375. }
  376. b = append(b, []byte{0x20}...)
  377. tz, _ := t.Zone()
  378. if btz, ok := lkt.timezones[tz]; ok {
  379. b = append(b, btz...)
  380. } else {
  381. b = append(b, tz...)
  382. }
  383. return string(b)
  384. }